updated skyscraper.sh

This commit is contained in:
2022-05-08 11:10:06 +02:00
parent 0e40eca94b
commit c26867a66f
2 changed files with 27 additions and 18 deletions
+12 -3
View File
@@ -3,12 +3,16 @@
###uncomment below if required software not on system ###uncomment below if required software not on system
#sudo apt-get install -y mame-tools p7zip-full #sudo apt-get install -y mame-tools p7zip-full
sourcedir="$1" readonly sourcedir="$1"
destdir="$2" readonly destdir="$2"
#extract zip # procesa el fitxer
for zipfile in "${sourcedir}"/*.zip; do for zipfile in "${sourcedir}"/*.zip; do
gameName="$(basename "$zipfile" .zip)" gameName="$(basename "$zipfile" .zip)"
if [ -f "${destdir}/${gameName}.chd" ]; then
echo -e "\e[1m\e[41m${gameName}.chd already exists\033[0m"
else
echo -e "\e[1m\e[41mExtracting ${gameName}...\033[0m" echo -e "\e[1m\e[41mExtracting ${gameName}...\033[0m"
7z x "${zipfile}" -o"${destdir}/${gameName}-tmp" 7z x "${zipfile}" -o"${destdir}/${gameName}-tmp"
@@ -18,10 +22,15 @@ for zipfile in "${sourcedir}"/*.zip; do
#rm temporary directory #rm temporary directory
rm -rdf "${destdir}/${gameName}-tmp" rm -rdf "${destdir}/${gameName}-tmp"
fi
### uncomment below to rm the original zip archive ### uncomment below to rm the original zip archive
#rm ./"$zipfile" #rm ./"$zipfile"
if [ "$3" = "-remove" ]; then
rm ./"$zipfile"
fi
echo "!!!!!!!!!!${gameName} complete..." echo "!!!!!!!!!!${gameName} complete..."
done done
+8 -8
View File
@@ -3,19 +3,19 @@
## usage ## usage
USAGE=" USAGE="
USAGE: USAGE:
$(basename "$0") [BUILD | SCRAP | BOTH] [FRONTEND] [PATH]" $(basename "$0") [BUILD | SCRAP | BOTH] [artwork.xml] [path]"
readonly USAGE readonly USAGE
FRONTENDS="emulationstation pegasus" #FRONTENDS="emulationstation pegasus"
readonly FRONTENDS #readonly FRONTENDS
function help_message() { function help_message() {
echo "$USAGE" echo "$USAGE"
echo echo
echo "Where [FRONTEND] are:" #echo "Where [FRONTEND] are:"
for WORD in $FRONTENDS; do #for WORD in $FRONTENDS; do
echo -e "\t$WORD" # echo -e "\t$WORD"
done #done
} }
## check if there are all the parameters ## check if there are all the parameters
@@ -32,7 +32,7 @@ if ! echo "$FRONTENDS" | grep -w "$2" >/dev/null; then
fi fi
## parameters ## parameters
readonly FRONTEND="$2" #readonly FRONTEND="$2"
readonly ROM_DIR="$3" readonly ROM_DIR="$3"
## colors ## colors