diff --git a/Cargo.lock b/Cargo.lock index 4d56b0bdb..d9b5b06c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -987,6 +987,7 @@ dependencies = [ "crossterm", "dialoguer", "dirs", + "dunce", "flate2", "futures", "git2", diff --git a/cargo-shuttle/Cargo.toml b/cargo-shuttle/Cargo.toml index efccd1efb..c71e9f842 100644 --- a/cargo-shuttle/Cargo.toml +++ b/cargo-shuttle/Cargo.toml @@ -22,6 +22,7 @@ crossbeam-channel = "0.5.6" crossterm = "0.25.0" dialoguer = { version = "0.10.2", features = ["fuzzy-select"] } dirs = "4.0.0" +dunce = "1.0.3" flate2 = "1.0.25" futures = "0.3.25" git2 = "0.14.2" diff --git a/cargo-shuttle/src/args.rs b/cargo-shuttle/src/args.rs index abb623fee..9810a7a21 100644 --- a/cargo-shuttle/src/args.rs +++ b/cargo-shuttle/src/args.rs @@ -1,6 +1,6 @@ use std::{ ffi::OsString, - fs::{canonicalize, create_dir_all}, + fs::create_dir_all, io::{self, ErrorKind}, path::PathBuf, }; @@ -241,7 +241,7 @@ impl InitArgs { // Helper function to parse and return the absolute path fn parse_path(path: OsString) -> Result { - canonicalize(&path).map_err(|e| format!("could not turn {path:?} into a real path: {e}")) + dunce::canonicalize(&path).map_err(|e| format!("could not turn {path:?} into a real path: {e}")) } // Helper function to parse, create if not exists, and return the absolute path