From 08367c6db714d3df8feedd2b788c6cc6c527ce8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=95=D0=B3=D0=BE=D1=80=20=D0=9A=D1=83=D0=BA=D0=BB=D0=B8?= =?UTF-8?q?=D0=BD?= <40146818+TheBlek@users.noreply.github.com> Date: Sat, 17 Aug 2024 05:39:34 +0700 Subject: [PATCH] Replace std::fs::canonicalize with dunce::canonicalize (#858) Closes #830 by going back to non-UNC paths on windows sample.bat: ``` echo Hello world ``` `cargo run -r -- .\sample.bat` now runs as expected. Added the same version of dunce as in `ignore-files/Cargo.toml` --- Cargo.lock | 1 + crates/cli/Cargo.toml | 1 + crates/cli/src/args.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 30e306c8..d037380c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4085,6 +4085,7 @@ dependencies = [ "console-subscriber", "dashmap", "dirs 5.0.1", + "dunce", "embed-resource", "eyra", "futures", diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 9618ba74..babda9ff 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -29,6 +29,7 @@ clap_mangen = "0.2.15" clearscreen = "3.0.0" dashmap = "5.4.0" dirs = "5.0.0" +dunce = "1.0.4" futures = "0.3.29" humantime = "2.1.0" indexmap = "2.2.6" # needs to be in sync with jaq's diff --git a/crates/cli/src/args.rs b/crates/cli/src/args.rs index 2b2e76e7..778daf73 100644 --- a/crates/cli/src/args.rs +++ b/crates/cli/src/args.rs @@ -1,13 +1,14 @@ use std::{ collections::BTreeSet, ffi::{OsStr, OsString}, - fs::canonicalize, mem::take, path::{Path, PathBuf}, str::FromStr, time::Duration, }; +use dunce::canonicalize; + use clap::{ builder::TypedValueParser, error::ErrorKind, Arg, Command, CommandFactory, Parser, ValueEnum, ValueHint,