updated skyscraper.sh
This commit is contained in:
+19
-10
@@ -3,25 +3,34 @@
|
|||||||
###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)"
|
||||||
echo -e "\e[1m\e[41mExtracting ${gameName}...\033[0m"
|
|
||||||
7z x "${zipfile}" -o"${destdir}/${gameName}-tmp"
|
|
||||||
|
|
||||||
#convet to chd
|
if [ -f "${destdir}/${gameName}.chd" ]; then
|
||||||
echo -e "\e[1m\e[41mConverting ${gameName}...\033[0m"
|
echo -e "\e[1m\e[41m${gameName}.chd already exists\033[0m"
|
||||||
find "${destdir}/${gameName}-tmp/" -type f -iname "*.cue" -exec chdman createcd -i {} -o "${destdir}/${gameName}.chd" \;
|
else
|
||||||
|
echo -e "\e[1m\e[41mExtracting ${gameName}...\033[0m"
|
||||||
|
7z x "${zipfile}" -o"${destdir}/${gameName}-tmp"
|
||||||
|
|
||||||
#rm temporary directory
|
#convet to chd
|
||||||
rm -rdf "${destdir}/${gameName}-tmp"
|
echo -e "\e[1m\e[41mConverting ${gameName}...\033[0m"
|
||||||
|
find "${destdir}/${gameName}-tmp/" -type f -iname "*.cue" -exec chdman createcd -i {} -o "${destdir}/${gameName}.chd" \;
|
||||||
|
|
||||||
|
#rm temporary directory
|
||||||
|
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
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user