From 0f437199b65025a903d568be87747cf5eb4b9805 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 26 Jun 2022 01:59:38 +0400 Subject: Support for *linux.7z archives --- process.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'process.sh') diff --git a/process.sh b/process.sh index 06bba28..865a5c2 100755 --- a/process.sh +++ b/process.sh @@ -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 -- cgit v1.2.3