aces / Loris-MRI

The set of scripts that preprocess and insert MRI data into the database.
10 stars 50 forks source link

Error message from file program when the pipeline is run on an empty archive #1013

Closed nicolasbrossard closed 1 year ago

nicolasbrossard commented 1 year ago

When trying to run the MRI pipeline on an empty archive, I got this error message:

Usage: file [-bcEhikLlNnprsvzZ0] [--apple] [--extension] [--mime-encoding] [--mime-type]
            [-e testname] [-F separator] [-f namefile] [-m magicfiles] file ...
       file -C [-m magicfiles]
       file [--help]

since the pipeline attempts to run file on an empty set of files and consequently builds an invalid Unix command in trying to do so. This PR will first check if the list of files on which file should be run is empty before attempting to run the command, thereby getting rid of the error message.

Fixes #1012