Skip to content

Commit

Permalink
update tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Sep 2, 2023
1 parent 081f662 commit 1de9f6c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/update_intended_for.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def main():
was_str = True
intended_for = [intended_for]

update = False
for i, intended_for_path in enumerate(intended_for):
if intended_for_path.startswith("bids:"):
continue
Expand All @@ -59,6 +60,8 @@ def main():
print(f"[red]will not update {intended_for_path}[/red]")
continue

update = True

filename = Path(intended_for_path).name
subject = filename.split("_")[0]

Expand All @@ -75,10 +78,9 @@ def main():
if was_str:
intended_for = intended_for[0]

if VERBOSE:
print(intended_for)

if not DRY_RUN:
if update and not DRY_RUN:
if VERBOSE:
print(intended_for)
with open(json_path, "w") as f:
content["IntendedFor"] = intended_for
json.dump(content, f, indent=1)
Expand Down

0 comments on commit 1de9f6c

Please sign in to comment.