functions/exec.sh contains functions to help execute commands.
Takes a command as input, prints the command, and detects if anything was written to
stderr. If there was, the error is printed to
stderr again, and if
WAFFLES_EXIT_ON_ERROR is set, Waffles halts.
exec.capture_error apt-get update
A simple wrapper around
if [[ waffles.command_exists apt-get ]]; then log.info "We're on a Debian-based system." fi
Prints the command being run, but suppresses the command output.
exec.mute apt-get update
Runs a command as another user via sudo:
exec.sudo username tar xzvf foobar.tar.gz