Skip to content

Commit

Permalink
Raise error if FS_LICENSE env var isn't a file.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Feb 29, 2024
1 parent 5867423 commit 46f9c23
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xcp_d/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,16 @@ def _validate_parameters(opts, build_log):
else:
build_log.error(f"Freesurfer license DNE: {opts.fs_license_file}.")
return_code = 1
else:
fs_license_file = os.environ.get("FS_LICENSE", "/opt/freesurfer/license.txt")
if not Path(fs_license_file).is_file():
build_log.error(
"A valid FreeSurfer license file is required. "
"Set the FS_LICENSE environment variable or use the '--fs-license-file' flag."
)
return_code = 1

os.environ["FS_LICENSE"] = str(fs_license_file)

# Check the validity of inputs
if opts.output_dir == opts.fmri_dir:
Expand Down

0 comments on commit 46f9c23

Please sign in to comment.