From 54ca36c457d37f8be23ff9b511c0b43868da6342 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Sun, 13 Nov 2022 22:18:12 +0100 Subject: [PATCH] fix: Fix specifying single output file --- src/bin/cmd/bundle/decompress.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/bin/cmd/bundle/decompress.rs b/src/bin/cmd/bundle/decompress.rs index 804f489..d3b7367 100644 --- a/src/bin/cmd/bundle/decompress.rs +++ b/src/bin/cmd/bundle/decompress.rs @@ -68,14 +68,10 @@ pub(crate) async fn run(ctx: Arc>, matches: &ArgMatches) - .get_one::("destination") .expect("required parameter 'destination' is missing"); - let is_dir = { - let meta = fs::metadata(out_path) - .await - .wrap_err("failed to access destination path") - .with_section(|| out_path.display().to_string().header("Path:"))?; - - meta.is_dir() - }; + let is_dir = fs::metadata(out_path) + .await + .map(|meta| meta.is_dir()) + .unwrap_or(false); let paths = collect_bundle_paths(bundles).await;