From 2d7b126681c603db296b91da344da00386e2a840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oddbj=C3=B8rn=20Gr=C3=B8dem?= <29732646+oddgrd@users.noreply.github.com> Date: Thu, 16 Mar 2023 14:52:41 +0000 Subject: [PATCH] fix: windows local run path bug (#721) --- Cargo.lock | 1 + cargo-shuttle/Cargo.toml | 1 + cargo-shuttle/src/args.rs | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) 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