From 3202f5d50fd583b8b7b55f7ee3be0dafa595d59a Mon Sep 17 00:00:00 2001 From: Ayush Kamat Date: Thu, 26 Oct 2023 14:02:01 -0700 Subject: [PATCH] better error when download dest doesnt exist Signed-off-by: Ayush Kamat --- latch_cli/services/cp/download.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/latch_cli/services/cp/download.py b/latch_cli/services/cp/download.py index 81741adb..357c7c73 100644 --- a/latch_cli/services/cp/download.py +++ b/latch_cli/services/cp/download.py @@ -39,6 +39,14 @@ def download( dest: Path, config: CPConfig, ): + if not dest.parent.exists(): + click.secho( + f"Invalid copy destination {dest}. Parent directory {dest.parent} does not" + " exist.", + fg="red", + ) + raise click.exceptions.Exit(1) + normalized = normalize_path(src) data = get_node_data(src)