Skip to content

Commit

Permalink
fix: make it work on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
iho committed Oct 9, 2023
1 parent 7b1002d commit a675e70
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cargo-near/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a675e70

Please sign in to comment.