From a94a3bdd8f7992f23ea228af5d170e65f74e9f2b Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sat, 13 Aug 2022 18:09:37 +0200 Subject: [PATCH] with current_dir --- cuddle_cli/src/actions/shell.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cuddle_cli/src/actions/shell.rs b/cuddle_cli/src/actions/shell.rs index e03ffd1..312beb4 100644 --- a/cuddle_cli/src/actions/shell.rs +++ b/cuddle_cli/src/actions/shell.rs @@ -1,4 +1,4 @@ -use std::{path::PathBuf, process::Command}; +use std::{env::current_dir, path::PathBuf, process::Command}; use crate::cli::CuddleVariable; @@ -32,7 +32,11 @@ Starting running shell action: {} return Err(anyhow::anyhow!("file not found aborting")); } + let current_dir = current_dir()?; + log::trace!("current executable dir={}", current_dir.to_string_lossy()); + let mut process = Command::new(path) + .current_dir(current_dir) .envs(variables.iter().map(|v| { log::trace!("{:?}", v);