Skip to content
Snippets Groups Projects
Commit 411e255a authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

RF: Handle FSLDIR=child env

parent 96a4bacb
No related branches found
No related tags found
1 merge request!46Mnt/update fsl package
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment