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`
This commit is contained in:
Егор Куклин 2024-08-17 05:39:34 +07:00 committed by GitHub
parent 2cc7743677
commit 08367c6db7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 1 deletions

1
Cargo.lock generated
View File

@ -4085,6 +4085,7 @@ dependencies = [
"console-subscriber", "console-subscriber",
"dashmap", "dashmap",
"dirs 5.0.1", "dirs 5.0.1",
"dunce",
"embed-resource", "embed-resource",
"eyra", "eyra",
"futures", "futures",

View File

@ -29,6 +29,7 @@ clap_mangen = "0.2.15"
clearscreen = "3.0.0" clearscreen = "3.0.0"
dashmap = "5.4.0" dashmap = "5.4.0"
dirs = "5.0.0" dirs = "5.0.0"
dunce = "1.0.4"
futures = "0.3.29" futures = "0.3.29"
humantime = "2.1.0" humantime = "2.1.0"
indexmap = "2.2.6" # needs to be in sync with jaq's indexmap = "2.2.6" # needs to be in sync with jaq's

View File

@ -1,13 +1,14 @@
use std::{ use std::{
collections::BTreeSet, collections::BTreeSet,
ffi::{OsStr, OsString}, ffi::{OsStr, OsString},
fs::canonicalize,
mem::take, mem::take,
path::{Path, PathBuf}, path::{Path, PathBuf},
str::FromStr, str::FromStr,
time::Duration, time::Duration,
}; };
use dunce::canonicalize;
use clap::{ use clap::{
builder::TypedValueParser, error::ErrorKind, Arg, Command, CommandFactory, Parser, ValueEnum, builder::TypedValueParser, error::ErrorKind, Arg, Command, CommandFactory, Parser, ValueEnum,
ValueHint, ValueHint,