diff --git a/cuddle_cli/src/actions/shell.rs b/cuddle_cli/src/actions/shell.rs index add8292..ae042ca 100644 --- a/cuddle_cli/src/actions/shell.rs +++ b/cuddle_cli/src/actions/shell.rs @@ -1,4 +1,4 @@ -use std::process::Command; +use std::{path::PathBuf, process::Command}; use crate::cli::CuddleVariable; @@ -26,7 +26,13 @@ Starting running shell action: {} self.path.clone() ); - let mut process = Command::new(self.path) + let path = PathBuf::from(self.path.clone()); + if !path.exists() { + log::info!("script='{}' not found, aborting", path.to_string_lossy()); + return Err(anyhow::anyhow!("file not found aborting")); + } + + let mut process = Command::new(path) .current_dir(".") .envs(variables.iter().map(|v| { log::trace!("{:?}", v);