diff --git a/fsl/utils/run.py b/fsl/utils/run.py index db6af1925519819186d7c17222037e6ed80b257f..7211965d773f03d6c3abd583e3a4776bebaf7c2c 100644 --- a/fsl/utils/run.py +++ b/fsl/utils/run.py @@ -3,6 +3,7 @@ # run.py - Functions for running shell commands # # Author: Paul McCarthy <pauldmccarthy@gmail.com> +# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk> # """This module provides some functions for running shell commands. @@ -358,6 +359,12 @@ def runfsl(*args, **kwargs): args[0] = cmdpath break + # error if the command cannot + # be found in a FSL directory + else: + raise FileNotFoundError('FSL tool {} not found (checked {})'.format( + args[0], ', '.join(prefixes))) + return run(*args, **kwargs)