From 80f0f2d2bf3d9836eef16f9f6d3bed5f88c8ff05 Mon Sep 17 00:00:00 2001 From: Tarik Zegmott Date: Thu, 5 Sep 2024 12:05:48 -0400 Subject: [PATCH] fix(clear): reorganise file_paths manipulation logic Signed-off-by: Tarik Zegmott --- dtcli/src/functions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dtcli/src/functions.py b/dtcli/src/functions.py index 3d0527e..f56d272 100644 --- a/dtcli/src/functions.py +++ b/dtcli/src/functions.py @@ -412,9 +412,11 @@ def find_dataset_common_path( # Build data paths. if dataset_locations["file_replica_locations"].get("minoc"): # type: ignore file_uris = dataset_locations["file_replica_locations"]["minoc"] # type: ignore - file_paths = [f.replace("cadc:CHIMEFRB/", "") for f in file_uris] + file_paths = [ + f.replace("//", "/").replace("cadc:CHIMEFRB/", "") for f in file_uris + ] - common_path = os.path.commonprefix(file_paths).replace("//", "/") + common_path = os.path.commonprefix(file_paths) if common_path[-1] != "/": common_path = "/".join(common_path.split("/")[:-1])