Skip to content

Commit 01f3fe9

Browse files
committed
fix: clear error when wkg get output directory does not exist
1 parent 6416f12 commit 01f3fe9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

crates/wkg/src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,13 @@ impl GetArgs {
322322
.context("Failed to resolve output parent dir")?
323323
};
324324

325+
if !parent_dir.exists() {
326+
anyhow::bail!(
327+
"output directory {:?} does not exist; create it first or choose a different path",
328+
parent_dir
329+
);
330+
}
331+
325332
let (tmp_file, tmp_path) =
326333
tempfile::NamedTempFile::with_prefix_in(".wkg-get", parent_dir)?.into_parts();
327334
tracing::debug!(?tmp_path, "Created temporary file");

0 commit comments

Comments
 (0)