Skip to content
Snippets Groups Projects

Mnt/update fsl package

Merged Paul McCarthy requested to merge mnt/update-fsl-package into master
1 file
+ 15
0
Compare changes
  • Side-by-side
  • Inline
@@ -88,9 +88,24 @@ def conda(cmd : str, capture_output=True, **kwargs) -> str:
Keyword arguments are passed through to subprocess.run.
"""
fsldir = os.environ['FSLDIR']
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}')
kwargs['check'] = False
Loading