added better path handling
This commit is contained in:
parent
f0488cded8
commit
dc0f27a8e8
@ -1,4 +1,4 @@
|
|||||||
use std::process::Command;
|
use std::{path::PathBuf, process::Command};
|
||||||
|
|
||||||
use crate::cli::CuddleVariable;
|
use crate::cli::CuddleVariable;
|
||||||
|
|
||||||
@ -26,7 +26,13 @@ Starting running shell action: {}
|
|||||||
self.path.clone()
|
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(".")
|
.current_dir(".")
|
||||||
.envs(variables.iter().map(|v| {
|
.envs(variables.iter().map(|v| {
|
||||||
log::trace!("{:?}", v);
|
log::trace!("{:?}", v);
|
||||||
|
Loading…
Reference in New Issue
Block a user