Class pinnacle.process ​
Process management.
This module provides utilities to spawn processes and capture their output.
Functions ​
function spawn ​
function pinnacle.process.spawn(...: string)
-> pinnacle.process.Child?Spawns a process, returning a Child with the process's standard IO if successful.
Receives the arguments of the command to be spawned, either as varargs or as a table.
For more control over the spawn, use Process.command instead.
Parameters ​
...: string - The arguments of the command.
Returns ​
pinnacle.process.Child- A child with the process's standard IO, ornilif the process failed to spawn or doesn't exist.
See also ​
pinnacle.process.Process.command: A way to spawn processes with more control.
function spawn_once ​
function pinnacle.process.spawn_once(...: string)
-> pinnacle.process.Child?Spawns a process if it hasn't been spawned before, returning a Child with the process's standard IO if successful.
Receives the arguments of the command to be spawned, either as varargs or as a table.
For more control over the spawn, use Process.command instead.
Parameters ​
...: string - The arguments of the command.
Returns ​
pinnacle.process.Child- A child with the process's standard IO, ornilif the process failed to spawn or doesn't exist.
See also ​
pinnacle.process.Process.command: A way to spawn processes with more control.
function spawn_unique ​
function pinnacle.process.spawn_unique(...: string)
-> pinnacle.process.Child?Spawns a process if it isn't already running, returning a Child with the process's standard IO if successful.
Receives the arguments of the command to be spawned, either as varargs or as a table.
For more control over the spawn, use Process.command instead.
Parameters ​
...: string - The arguments of the command.
Returns ​
pinnacle.process.Child- A child with the process's standard IO, ornilif the process failed to spawn or doesn't exist.
See also ​
pinnacle.process.Process.command: A way to spawn processes with more control.
function command ​
function pinnacle.process.command(cmd: pinnacle.process.CommandOpts)
-> pinnacle.process.CommandCreates a Command from the given options.
A Command represents a to-be-spawned process.
Parameters ​
cmd: pinnacle.process.CommandOpts - Options for the command.
Returns ​
pinnacle.process.Command- An object that allows you to spawn this command.
function set_env ​
function pinnacle.process.set_env(key: string, value: string)Adds an environment variable that all newly spawned processes will inherit.
Parameters ​
key: string - The environment variable's key.value: string - The environment variable's value.