Report an error if trying to delete a non-existent path

This commit is contained in:
Michael Zhang 2021-12-30 17:33:11 -06:00
parent 797a521c86
commit b8d2be4abe
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B

View file

@ -68,6 +68,11 @@ pub fn put(options: PutOptions) -> Result<()> {
for path in options.paths.iter() {
let abs_path = utils::into_absolute(&path)?;
if !abs_path.exists() {
error!("Skipping non-existent path {:?}", path);
continue;
}
// don't allow deleting '.' or '..'
let current_dir = env::current_dir()?;
let parent = current_dir.parent();