mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 19:45:29 +00:00
Omit "./" at the start of the path (#109)
This commit is contained in:
parent
1337be4f49
commit
2e6cd893dc
@ -3,6 +3,7 @@
|
||||
use std::{
|
||||
env, fs,
|
||||
io::{self, prelude::*},
|
||||
path::Component,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
@ -47,6 +48,7 @@ where
|
||||
fs::create_dir_all(&path)?;
|
||||
}
|
||||
}
|
||||
let file_path = file_path.strip_prefix(Component::CurDir).unwrap_or_else(|_| file_path.as_path());
|
||||
|
||||
info!("{:?} extracted. ({})", file_path.display(), Bytes::new(file.size()));
|
||||
|
||||
|
@ -2,6 +2,7 @@ use std::{
|
||||
cmp, env,
|
||||
ffi::OsStr,
|
||||
fs::{self, ReadDir},
|
||||
path::Component,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
@ -45,6 +46,7 @@ pub fn user_wants_to_overwrite(path: &Path, flags: &oof::Flags) -> crate::Result
|
||||
_ => {}
|
||||
}
|
||||
|
||||
let path = path.strip_prefix(Component::CurDir).unwrap_or_else(|_| path);
|
||||
Confirmation::new("Do you want to overwrite 'FILE'?", Some("FILE")).ask(Some(&to_utf(path)))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user