mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-18 09:50:34 +01:00
Fix root directory for Windows
This commit is contained in:
parent
9d26b74c2a
commit
87ba4e3bb0
1 changed files with 6 additions and 1 deletions
|
@ -58,7 +58,12 @@ fn main() {
|
||||||
|
|
||||||
// Get the root directory for the search
|
// Get the root directory for the search
|
||||||
let mut root_dir_buf = match matches.value_of("path") {
|
let mut root_dir_buf = match matches.value_of("path") {
|
||||||
Some(path) => PathBuf::from(path),
|
Some(path) => {
|
||||||
|
#[cfg(windows)]
|
||||||
|
let path = path.replace('/', "\\");
|
||||||
|
|
||||||
|
PathBuf::from(path)
|
||||||
|
}
|
||||||
None => current_dir.to_path_buf(),
|
None => current_dir.to_path_buf(),
|
||||||
};
|
};
|
||||||
if !fshelper::is_dir(&root_dir_buf) {
|
if !fshelper::is_dir(&root_dir_buf) {
|
||||||
|
|
Loading…
Reference in a new issue