Report an error if trying to delete a non-existent path
This commit is contained in:
parent
797a521c86
commit
b8d2be4abe
1 changed files with 5 additions and 0 deletions
|
@ -68,6 +68,11 @@ pub fn put(options: PutOptions) -> Result<()> {
|
||||||
for path in options.paths.iter() {
|
for path in options.paths.iter() {
|
||||||
let abs_path = utils::into_absolute(&path)?;
|
let abs_path = utils::into_absolute(&path)?;
|
||||||
|
|
||||||
|
if !abs_path.exists() {
|
||||||
|
error!("Skipping non-existent path {:?}", path);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// don't allow deleting '.' or '..'
|
// don't allow deleting '.' or '..'
|
||||||
let current_dir = env::current_dir()?;
|
let current_dir = env::current_dir()?;
|
||||||
let parent = current_dir.parent();
|
let parent = current_dir.parent();
|
||||||
|
|
Loading…
Reference in a new issue