macro_rules! macro_execute_and_log {
    ($command:expr, $package:expr, $operation:expr, $start_message:expr, $complete_message:expr, $error_message:expr) => { ... };
}
Expand description

Executes a shell command and logs the start, completion, and any errors.

Parameters

  • $command - The shell command to execute.
  • $package - The name of the package being operated on.
  • $operation - A description of the operation.
  • $start_message - The message to log at the start of the operation.
  • $complete_message - The message to log upon successful completion.
  • $error_message - The message to log in case of an error.

Returns

Returns a Result<(), anyhow::Error> to indicate the success or failure of the command execution.