updated skyscraper.sh
This commit is contained in:
+19
-10
@@ -3,24 +3,33 @@
|
||||
###uncomment below if required software not on system
|
||||
#sudo apt-get install -y mame-tools p7zip-full
|
||||
|
||||
sourcedir="$1"
|
||||
destdir="$2"
|
||||
readonly sourcedir="$1"
|
||||
readonly destdir="$2"
|
||||
|
||||
#extract zip
|
||||
# procesa el fitxer
|
||||
for zipfile in "${sourcedir}"/*.zip; do
|
||||
gameName="$(basename "$zipfile" .zip)"
|
||||
echo -e "\e[1m\e[41mExtracting ${gameName}...\033[0m"
|
||||
7z x "${zipfile}" -o"${destdir}/${gameName}-tmp"
|
||||
|
||||
#convet to chd
|
||||
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" \;
|
||||
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"
|
||||
7z x "${zipfile}" -o"${destdir}/${gameName}-tmp"
|
||||
|
||||
#rm temporary directory
|
||||
rm -rdf "${destdir}/${gameName}-tmp"
|
||||
#convet to chd
|
||||
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
|
||||
#rm ./"$zipfile"
|
||||
|
||||
if [ "$3" = "-remove" ]; then
|
||||
rm ./"$zipfile"
|
||||
fi
|
||||
|
||||
echo "!!!!!!!!!!${gameName} complete..."
|
||||
|
||||
|
||||
+8
-8
@@ -3,19 +3,19 @@
|
||||
## usage
|
||||
USAGE="
|
||||
USAGE:
|
||||
$(basename "$0") [BUILD | SCRAP | BOTH] [FRONTEND] [PATH]"
|
||||
$(basename "$0") [BUILD | SCRAP | BOTH] [artwork.xml] [path]"
|
||||
readonly USAGE
|
||||
|
||||
FRONTENDS="emulationstation pegasus"
|
||||
readonly FRONTENDS
|
||||
#FRONTENDS="emulationstation pegasus"
|
||||
#readonly FRONTENDS
|
||||
|
||||
function help_message() {
|
||||
echo "$USAGE"
|
||||
echo
|
||||
echo "Where [FRONTEND] are:"
|
||||
for WORD in $FRONTENDS; do
|
||||
echo -e "\t$WORD"
|
||||
done
|
||||
#echo "Where [FRONTEND] are:"
|
||||
#for WORD in $FRONTENDS; do
|
||||
# echo -e "\t$WORD"
|
||||
#done
|
||||
}
|
||||
|
||||
## check if there are all the parameters
|
||||
@@ -32,7 +32,7 @@ if ! echo "$FRONTENDS" | grep -w "$2" >/dev/null; then
|
||||
fi
|
||||
|
||||
## parameters
|
||||
readonly FRONTEND="$2"
|
||||
#readonly FRONTEND="$2"
|
||||
readonly ROM_DIR="$3"
|
||||
|
||||
## colors
|
||||
|
||||
Reference in New Issue
Block a user