module MStrap::DSL::System

Direct including types

Defined in:


Instance Method Summary

Instance Method Detail

def cmd(env : Hash | Nil, command : String, args : Array(String) | Nil, shell = true, input = Process::Redirect::Inherit, output = Process::Redirect::Inherit, error = Process::Redirect::Inherit, quiet = false, sudo = false) #

Executes a given command and waits for it to complete, returning whether the exit status indicated success.

By default the process is configured with input, output, and error of the mstrap process.

  • env: optionally specifies the environment for the command
  • command: specifies the command to run. Arguments are allowed here, if args are omitted and will be evaluated by the system shell.
  • args: optionally specifies arguments for the command. These will not be processed by the shell.
  • shell: specifies whether to run the command through the system shell
  • input: specifies where to direct STDIN on the spawned process
  • output: specifies where to direct STDOUT on the spawned process
  • error: specifies where to direct STDERR on the spawned process
  • quiet: If passed as true, it does no logging. If mstrap is running in debug mode, process output is always logged.
  • sudo: specifies whether to run the command with superuser privileges

[View source]