Skip to content

script-utils/exec

Contains utility functions for executing commands.

InterfaceDescription
ExecArgA command argument that contains a list of args to be batched. If the expanded command exceeds the platform’s max command length, the batched args are split into sequential executions.
ExecDetailedOptionsOptions for exec that return detailed results.
ExecOptionsOptions for executing a command.
ExecResultA result of exec.
ExecSimpleOptionsOptions for exec that return only stdout.
FunctionDescription
appendNodeOptionAppends a single node CLI option to a NODE_OPTIONS string, preserving any options already present.
buildChildEnvBuilds the environment for child processes: the parent environment plus DEBUG_COLORS, and — when the running node supports it — LOCAL_STORAGE_NODE_OPTION appended to NODE_OPTIONS. The support check guards against older node (< 22): passing an option node does not recognize via NODE_OPTIONS makes it exit before running, which would break every spawned tool.
execExecutes a command.
TypeDescription
CommandPartA command part: either a plain string or an ExecArg with batched arguments.