From a675e7098f9c6252a9ae6e6af6ebf123013ce953 Mon Sep 17 00:00:00 2001 From: iho Date: Tue, 10 Oct 2023 02:48:08 +0300 Subject: [PATCH] fix: make it work on Windows --- cargo-near/src/util/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cargo-near/src/util/mod.rs b/cargo-near/src/util/mod.rs index 7478bcd0..a1eb65b9 100644 --- a/cargo-near/src/util/mod.rs +++ b/cargo-near/src/util/mod.rs @@ -57,6 +57,13 @@ where if let Some(path) = working_dir { let path = path.as_ref(); log::debug!("Setting cargo working dir to '{}'", 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); }