Skip to content
Snippets Groups Projects

Mnt/update fsl package

Merged Paul McCarthy requested to merge mnt/update-fsl-package into master
5 files
+ 71
18
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -88,9 +88,24 @@ def conda(cmd : str, capture_output=True, **kwargs) -> str:
@@ -88,9 +88,24 @@ def conda(cmd : str, capture_output=True, **kwargs) -> str:
Keyword arguments are passed through to subprocess.run.
Keyword arguments are passed through to subprocess.run.
"""
"""
 
fsldir = os.environ['FSLDIR']
fsldir = os.environ['FSLDIR']
condabin = op.join(fsldir, 'bin', 'conda')
condabin = op.join(fsldir, 'bin', 'conda')
 
# If FSLDIR is a child env, we won't be able
 
# to find the conda executable. In this case,
 
# we have to assume that we can call "conda".
 
candidates = [
 
op.join(fsldir, 'bin', 'conda'),
 
op.join(fsldir, 'condabin', 'conda'),
 
]
 
 
for condabin in candidates:
 
if op.exists(condabin):
 
break
 
else:
 
condabin = 'conda'
 
log.debug(f'Running {condabin} {cmd}')
log.debug(f'Running {condabin} {cmd}')
kwargs['check'] = False
kwargs['check'] = False
@@ -566,7 +581,7 @@ def parse_args(argv : Optional[Sequence[str]]) -> argparse.Namespace:
@@ -566,7 +581,7 @@ def parse_args(argv : Optional[Sequence[str]]) -> argparse.Namespace:
# externally hosted package has been requested
# externally hosted package has been requested
if (len(args.package) > 0) and \
if (len(args.package) > 0) and \
any(args.package in EXTERNALLY_HOSTED_PACKAGES):
any(p in EXTERNALLY_HOSTED_PACKAGES for p in args.package):
args.external = True
args.external = True
return args
return args
Loading