class

Hwaro::Utils::CommandRunner

Inherits Reference < Object

Class methods

run(command : String, working_dir : String | Nil = nil) : Result

Execute a single command and return the result

Source
run_all(commands : Array(String), working_dir : String | Nil = nil, label : String = "hook") : Bool

Execute multiple commands sequentially Returns true if all commands succeed, false otherwise

Source
run_post_hooks(commands : Array(String)) : Bool

Execute post-build hooks

Source
run_pre_hooks(commands : Array(String)) : Bool

Execute pre-build hooks

Source
shell_command(command : String) : String

The command line to hand Process with shell: true. That is sh -c on POSIX but a bare CreateProcess on Windows: no &&, pipes or redirects, and no .cmd shims (npm, npx). Wrap it in cmd.exe there, the way Node's shell: true does: %ComSpec% (not a cmd.exe found in the current directory), /s strips the outer quotes, /d skips AutoRun.

Source

Nested types