Wait for the process to complete
@eryx/os Module
JSON
Summary
Classes
Functions
API Reference
Classes
ProcessHandle
Properties
Process ID
Process return code, if it's exited
ProcessHandle:kill
Kill the process
Parameters
Optional signal to raise in process
ProcessHandle:write
Write data to the process' stdin
Parameters
Data to write
ProcessHandle:closeStdin
Close the connecting to the process' stdin
ProcessHandle:readStdout
Read any data available on stdout
ProcessHandle:readStderr
Read any data available on stderr
Functions
os.getenv
Get a specific environment variable
Parameters
string Environment variable to get
os.setenv
Set or unset a specific environment variable
Parameters
string Environment variable to set
string? Value to set, or nil to unset
os.environ
Get all currently defined environment variables
os.luauVersion
Get the git hash of Luau
There are no official "proper" version numbers for Luau, so the values here are derived from git.
The hash is the most reliable value, and indicates the exact version of Luau compiled against
The release is based on most recent tag, and typically follows the format 0.xxx, but can include
additional information if the tagged commit is not the most recent
os.hostname
Get the current system hostname
os.tmpdir
Get the current user's temporary directory
os.homedir
Get the current user's home directory
os.cpucount
Get the number of CPUs present
os.totalmem
Get the total system memory in KiB
os.freemem
Get the free system memory in KiB
os.uptime
Get the system uptime in seconds
os.pid
Get the current process PID
os.exit
Exit the process with a specific status code
Parameters
number? Process exit code
os.clock
Get the current time of the system clock
os.cwd
Get the current working directory
os.chdir
Change the current working directory
Parameters
string New directory
os.cliargs
Get the command line arguments for this script.
Returns only the user-supplied arguments; the executable name, subcommand, and script path are automatically stripped.
For example, eryx run foo.luau --verbose bar returns {"--verbose", "bar"}.
os.exec
Execute a child process and wait for it to complete.
This function is equivalent to using:
os.spawn(...):wait()
Parameters
string The process to spawn. Can be either a complete path, or a name to be resolve on the PATH
SpawnOptions? Optional addition configuration
os.spawn
Spawn a process, returning an interactive handle to it
Parameters
string The process to spawn. Can be either a complete path, or a name to be resolve on the PATH
SpawnOptions? Optional addition configuration
os.shell
Run a command as if it was run on the shell.
This is similar to setting shell=true in SpawnOptions, but does not
attempt to capture input or output from the process.
SpawnOptions.shell is ignored when calling this function.
Warning
This function passes the provided argument directly to `cmd.exe /C`
Parameters
string The command to run
SpawnOptions? Optional addition configuration
Returns
number The process' status code after completion
Types
SpawnOptions
Specify the directory for the child process
Specify additional environment variables for the child process
Run this as a shell command
Warning
This passes the provided command and arguments directly to `cmd.exe /C`