diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2022-06-26 01:59:38 +0400 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2022-06-26 01:59:38 +0400 |
commit | 0f437199b65025a903d568be87747cf5eb4b9805 (patch) | |
tree | 72f05f8ce69af6348e5c2521632f5ada5781f3ba /process.sh | |
parent | 90d1bf5893a9a373eccd40693f801aa74c3ad36b (diff) | |
download | openmtbmap-0f437199b65025a903d568be87747cf5eb4b9805.tar.gz openmtbmap-0f437199b65025a903d568be87747cf5eb4b9805.tar.bz2 openmtbmap-0f437199b65025a903d568be87747cf5eb4b9805.tar.xz openmtbmap-0f437199b65025a903d568be87747cf5eb4b9805.zip |
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 |