Skip to content

Commit

Permalink
Merge pull request #109 from CHIMEFRB/107-bug-datatrail-clear-command…
Browse files Browse the repository at this point in the history
…-failing-to-clear-staged-basebandraw-data-on-arc-1

fix(clear): reorganise file_paths manipulation logic
  • Loading branch information
MWSammons committed Sep 5, 2024
2 parents aabcad1 + 80f0f2d commit fd14f9b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dtcli/src/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit fd14f9b

Please sign in to comment.