Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Sep 2, 2023
1 parent 8280696 commit 17d158f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/update_intended_for.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

from rich import print

VERBOSE = True
DRY_RUN = False
VERBOSE = False
DRY_RUN = True


def root_dir():
Expand All @@ -33,14 +33,15 @@ def root_dir():

def main():
for json_path in root_dir().glob("**/*.json"):
if VERBOSE:
print(f"Checking {json_path.relative_to(root_dir())}")

with open(json_path) as f:
content = json.load(f)

if "IntendedFor" not in content:
continue

print()
print(f"Checking {json_path.relative_to(root_dir())}")

intended_for = content["IntendedFor"]

Expand All @@ -56,8 +57,7 @@ def main():
if not intended_for_path.startswith(
("ses-", "anat", "func", "ieeg", "fmap", "perf", "micr")
):
if VERBOSE:
print(f"[red]will not update {intended_for_path}[/red]")
print(f"[red]will not update {intended_for_path}[/red]")
continue

filename = Path(intended_for_path).name
Expand Down

0 comments on commit 17d158f

Please sign in to comment.