diff --git a/src/main.rs b/src/main.rs index 60f8d72..6422ec1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,7 +61,23 @@ fn execute_hook(name: &str, hook: &Hook, data: &serde_json::Value) -> Result<()> if let Some(action) = &hook.action { info!("Execute `{}` from hook `{}`", action, name); - Command::new(action).spawn()?; + let action = action.split(" ").collect::>(); + + let command = Command::new(action[0]).args(&action[1..]).output()?; + + info!( + "Command `{}` exited with return code: {}", + action[0], command.status + ); + debug!( + "Output of command `{}` on stderr: {:?}", + action[0], &command.stderr + ); + trace!( + "Output of command `{}` on stdout: {:?}", + action[0], + &command.stdout + ); } Ok(())