diff options
Diffstat (limited to 'process.sh')
-rwxr-xr-x | process.sh | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -1,17 +1,27 @@ #! /bin/bash -for name in `ls downloads/*.exe`; do - if [[ "$name" =~ "velo" ]]; then - mapname=`basename $name .exe | cut -c 5-` - img=maps/velo-$mapname.img - else - mapname=`basename $name .exe | cut -c 4-` - img=maps/mtb-$mapname.img +for name in `find . -regextype posix-extended -iregex './downloads/.*(linux.7z|.exe)'`; do + if [[ "$name" =~ "linux.7z" ]]; then + if [[ "$name" =~ "velo" ]]; then + mapname=`basename $name linux.7z | cut -c 5-` + img=maps/velo-$mapname.img + else + mapname=`basename $name linux.7z | cut -c 4-` + img=maps/mtb-$mapname.img + fi + else + if [[ "$name" =~ "velo" ]]; then + mapname=`basename $name .exe | cut -c 5-` + img=maps/velo-$mapname.img + else + mapname=`basename $name .exe | cut -c 4-` + img=maps/mtb-$mapname.img + fi fi [ -f $img ] && continue - ./generate.sh $name + bash ./generate.sh "$name" "$mapname" "$img" if [ $? -ne 0 ]; then break fi |