From b8d2be4abefc37b7897f17ffa570c3a3a5f558f4 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Thu, 30 Dec 2021 17:33:11 -0600 Subject: [PATCH] Report an error if trying to delete a non-existent path --- src/ops/put.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ops/put.rs b/src/ops/put.rs index 6d42b7d..0f8b962 100644 --- a/src/ops/put.rs +++ b/src/ops/put.rs @@ -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();