From 5bdf80b2aaff9cb7dfd87e2bb1e0405c4d4e82e4 Mon Sep 17 00:00:00 2001 From: Lee Chagolla-Christensen Date: Thu, 16 Oct 2025 18:13:49 -0700 Subject: [PATCH] update CLI to support explicitly empty --folder --- projects/cli/cli/submit.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/projects/cli/cli/submit.py b/projects/cli/cli/submit.py index 582377a..b1bc39d 100644 --- a/projects/cli/cli/submit.py +++ b/projects/cli/cli/submit.py @@ -478,7 +478,7 @@ def calculate_metadata_path(file_path: Path, base_paths: Optional[list[Path]], f Otherwise, return the file path as-is. """ - if not folder or not base_paths: + if folder is None or not base_paths: return str(file_path) # Resolve to absolute paths @@ -513,11 +513,18 @@ def calculate_metadata_path(file_path: Path, base_paths: Optional[list[Path]], f # Shouldn't happen, but fallback return str(file_path) + # Normalize the relative path to use forward slashes + rel_path_normalized = str(rel_path).replace('\\', '/') + + # If folder is empty string, return just the relative path without any prefix + if folder == "": + return rel_path_normalized + # Ensure folder ends with path separator if it doesn't folder_normalized = folder.rstrip('/\\') # Join folder with relative path using Unix-style paths - result = folder_normalized + '/' + str(rel_path).replace('\\', '/') + result = folder_normalized + '/' + rel_path_normalized return result