Macro mini_functions::hash::macro_execute_and_log
source · macro_rules! macro_execute_and_log { ($command:expr, $package:expr, $operation:expr, $start_message:expr, $complete_message:expr, $error_message:expr) => { ... }; }
Expand description
Macros related to executing shell commands.
Executes a shell command, logs the start and completion of the operation, and handles any errors that occur.
Parameters
$command
: The shell command to execute.$package
: The name of the package the command is being run on.$operation
: A description of the operation being performed.$start_message
: The log message to be displayed at the start of the operation.$complete_message
: The log message to be displayed upon successful completion of the operation.$error_message
: The log message to be displayed in case of an error.
Returns
Returns a Result<(), anyhow::Error>
indicating the success or failure of the operation.