Skip to content

Commit

Permalink
bugfix in finding matching app name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Khan committed Feb 7, 2018
1 parent af0ac85 commit f9ed5e9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions bidsBatch
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,21 @@ function getContainer {
app_name=$1
bids_app_dir=$SINGULARITY_DIR/bids-apps

#get matching line for app_name
linenum=`awk -F '\t' '{print $1}' $app_list | grep -n $app_name`
linenum=${linenum%%:*}
linenum=1
foundmatch=0
for app in `awk -F '\t' '{print $1}' $app_list`
do

if [ "$app" = "$app_name" ]
then
foundmatch=1
break
fi
linenum=$((linenum+1))
done


if [ ! -n "$linenum" ]
if [ "$foundmatch" = 0 ]
then
echo "${app_name} does not exist in bids-app list!" >&2
exit 1
Expand Down

0 comments on commit f9ed5e9

Please sign in to comment.