Crate sh_exec

Source

Macros§

exec
Execute a shell command and return the output The command is formatted using the given arguments The command is printed if the verbose flag is set to true (useful for debugging)
s
Execute a shell command and return the output The command is formatted using the given arguments The command is printed at the INFO level The output of the command is printed at the DEBUG level In case of an error, the error is printed at the ERROR level The error is returned
trap_panics_and_errors
trap_panics_and_errors traps panics that might be issued when calling a given function It will print a nice error message in case a panic is trapped. This macro also traps errors, prints the error and exists the program with error code 1

Structs§

ShellError
Custom error type for shell command execution

Functions§

execute_command
Executes a shell command and returns a Result containing the command’s output
get_env
read the content of a given environment variable as a String if the environment variable does not exist, return a ShellError
main_run