diff --git a/cargo-near/src/util/mod.rs b/cargo-near/src/util/mod.rs index a1eb65b9..8ae2f91c 100644 --- a/cargo-near/src/util/mod.rs +++ b/cargo-near/src/util/mod.rs @@ -57,14 +57,15 @@ where if let Some(path) = working_dir { let path = path.as_ref(); log::debug!("Setting cargo working dir to '{}'", path); + cmd.current_dir(path); #[cfg(target_os = "windows")] { let mut path = path.as_std_path().to_string_lossy().to_string(); // remove first 4 elements from path string path.drain(..4); let path = std::path::PathBuf::from(path); + cmd.current_dir(path); } - cmd.current_dir(path); } cmd.arg(command);