This commit is contained in:
2021-04-29 09:32:28 +02:00
parent ac24388fa8
commit 1c7ffae9c0
3 changed files with 41 additions and 146 deletions
+4 -4
View File
@@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
function help_message() { function help_message() {
echo "$USAGE" printf "%s\n\n" "$USAGE"
echo printf "%s" "Where [SYSTEMS] are: "
echo "Where [SYSTEMS] are:"
for WORD in $SYSTEMS; do for WORD in $SYSTEMS; do
echo -e "\t$WORD" printf "%s" "$WORD "
done done
printf "\n"
} }
readonly USAGE=" readonly USAGE="
+19 -115
View File
@@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
## usage
readonly USAGE=" readonly USAGE="
USAGE: USAGE:
$(basename "$0") [BUILD | SCRAP | BOTH] [FRONTEND] [PATH]" $(basename "$0") [BUILD | SCRAP | BOTH] [FRONTEND] [PATH]"
@@ -12,65 +14,53 @@ function help_message() {
done done
} }
FRONTENDS="emulationstation pegasus" ## check if there are all the parameters
# check if there are all the parameters
if [ "$#" -ne 3 ]; then if [ "$#" -ne 3 ]; then
help_message help_message
exit 0 exit 0
fi fi
# check if the frontend parameter is valid ## check if the frontend parameter is valid
FRONTENDS="emulationstation pegasus"
if ! echo "$FRONTENDS" | grep -w "$2" >/dev/null; then if ! echo "$FRONTENDS" | grep -w "$2" >/dev/null; then
printf "%s\n" "You must enter a valid FRONTEND name." printf "%s\n" "You must enter a valid FRONTEND name."
help_message help_message
exit 0 exit 0
fi fi
# variables ## parameters
#readonly COLOR_BLACK=$(tput setaf 0)
#readonly COLOR_RED=$(tput setaf 1)
#readonly COLOR_GREEN=$(tput setaf 2)
#readonly COLOR_YELLOW=$(tput setaf 3)
#readonly COLOR_BLUE=$(tput setaf 4)
#readonly COLOR_MAGENTA=$(tput setaf 5)
#readonly COLOR_CYAN=$(tput setaf 6)
readonly COLOR_WHITE=$(tput setaf 7)
#readonly COLOR_BACKGROUND_BLACK=$(tput setab 0)
readonly COLOR_BACKGROUND_RED=$(tput setab 1)
#readonly COLOR_BACKGROUND_GREEN=$(tput setab 2)
#readonly COLOR_BACKGROUND_YELLOW=$(tput setab 3)
#readonly COLOR_BACKGROUND_BLUE=$(tput setab 4)
#readonly COLOR_BACKGROUND_MAGENTA=$(tput setab 5)
#readonly COLOR_BACKGROUND_CYAN=$(tput setab 6)
#readonly COLOR_BACKGROUND_WHITE=$(tput setab 7)
readonly RESET_COLOR=$(tput sgr0)
#readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
readonly FRONTEND="$2" readonly FRONTEND="$2"
readonly ROM_DIR="$3" readonly ROM_DIR="$3"
readonly CONSOLE_ART=artwork.xml.rgbpi ## colors
readonly ARCADE_ART=artwork.xml.rgbpi readonly COLOR_WHITE=$(tput setaf 7)
readonly COLOR_BACKGROUND_RED=$(tput setab 1)
readonly RESET_COLOR=$(tput sgr0)
## artwork.xml
readonly CONSOLE_ART=artwork.xml.cover
readonly ARCADE_ART=artwork.xml.cover
## scrapers
readonly CONSOLE_SCRAPERS="screenscraper mobygames thegamesdb" readonly CONSOLE_SCRAPERS="screenscraper mobygames thegamesdb"
readonly ARCADE_SCRAPERS="screenacraper arcadedb" readonly ARCADE_SCRAPERS="screenacraper arcadedb"
## flags
#readonly BUILD_FLAGS_CONSOLE="videos,unattend,forcefilename,relative,nobrackets,skipexistingcovers,skipexistingmarquees,skipexistingscreenshots,skipexistingvideos,skipexistingwheels" #readonly BUILD_FLAGS_CONSOLE="videos,unattend,forcefilename,relative,nobrackets,skipexistingcovers,skipexistingmarquees,skipexistingscreenshots,skipexistingvideos,skipexistingwheels"
readonly BUILD_FLAGS_CONSOLE="videos,unattend,forcefilename,relative" readonly BUILD_FLAGS_CONSOLE="videos,unattend,forcefilename,relative"
#readonly BUILD_FLAGS_ARCADE="videos,unattend,relative,nobrackets,skipexistingcovers,skipexistingmarquees,skipexistingscreenshots,skipexistingvideos,skipexistingwheels" #readonly BUILD_FLAGS_ARCADE="videos,unattend,relative,nobrackets,skipexistingcovers,skipexistingmarquees,skipexistingscreenshots,skipexistingvideos,skipexistingwheels"
readonly BUILD_FLAGS_ARCADE="videos,unattend,relative" readonly BUILD_FLAGS_ARCADE="videos,unattend,relative"
SCRAP=true ## check if BUID, SCRAP or BOTH
BUILD=true
if [ "$1" = scrap ] || [ "$1" = SCRAP ]; then if [ "$1" = scrap ] || [ "$1" = SCRAP ]; then
BUILD=false BUILD=false
SCRAP=true
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP ONLY ${RESET_COLOR}" printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP ONLY ${RESET_COLOR}"
sleep 1 sleep 1
fi fi
if [ "$1" = build ] || [ "$1" = BUILD ]; then if [ "$1" = build ] || [ "$1" = BUILD ]; then
BUILD=true
SCRAP=false SCRAP=false
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## BUILD ONLY ${RESET_COLOR}" printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## BUILD ONLY ${RESET_COLOR}"
sleep 1 sleep 1
@@ -141,89 +131,3 @@ fi
## post-script job. add extensions text to pegasus ## post-script job. add extensions text to pegasus
find "${ROM_DIR}" -type f -iname "metadata.pegasus.txt" -exec sed -i '2 a extensions: zip, chd, cue, iso, cso' {} \; find "${ROM_DIR}" -type f -iname "metadata.pegasus.txt" -exec sed -i '2 a extensions: zip, chd, cue, iso, cso' {} \;
## Available artworks
# artwork.xml.screenshot
# artwork.xml.cover
# artwork.xml.wheel
# artwork.xml.example1
## Available platforms:
# 3do
# 3ds
# amiga
# amstradcpc
# apple2
# arcade
# arcadia
# astrocde
# atari800
# atari2600
# atari5200
# atari7800
# atarijaguar
# atarilynx
# atarist
# c16
# c64
# c128
# coco
# coleco
# daphne
# dragon32
# dreamcast
# fba
# fds
# gameandwatch
# gamegear
# gb
# gba
# gbc
# gc
# genesis
# intellivision
# mame-advmame
# mame-libretro
# mame-mame4all
# mastersystem
# megacd
# megadrive
# msx
# n64
# nds
# neogeo
# nes
# ngp
# ngpc
# oric
# pc
# pc88
# pc98
# pcfx
# pcengine
# pokemini
# ports
# ps2
# psp
# psx
# saturn
# scummvm
# sega32x
# segacd
# sg-1000
# snes
# steam
# ti99
# trs-80
# vectrex
# vic20
# videopac
# virtualboy
# wii
# wonderswan
# wonderswancolor
# x68000
# x1
# zmachine
# zx81
# zxspectrum
+18 -27
View File
@@ -12,67 +12,58 @@ function help_message() {
printf "\n" printf "\n"
} }
SYSTEMS="3do 3ds amiga amstradcpc apple2 arcade arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fba fds gameandwatch gamegear gb gba gbc gc genesis intellivision mame-advmame mame-libretro mame-mame4all mastersystem megacd megadrive msx n64 nds neogeo nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes steam ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum" readonly SYSTEMS="3do 3ds amiga amstradcpc apple2 arcade arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fba fds gameandwatch gamegear gb gba gbc gc genesis intellivision mame-advmame mame-libretro mame-mame4all mastersystem megacd megadrive msx n64 nds neogeo nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes steam ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum"
readonly APP=/usr/local/bin/Skyscraper
# check if there are all the parameters ## check if there are all the parameters
if [ "$#" -ne 3 ]; then if [ "$#" -ne 3 ]; then
help_message help_message
exit 0 exit 0
fi fi
# check if the systems parameter is valid ## check if the systems parameter is valid
if ! echo "$SYSTEMS" | grep -w "$3" >/dev/null; then if ! echo "$SYSTEMS" | grep -w "$3" >/dev/null; then
printf "%s\n" "You must enter a valid SYSTEM name." printf "%s\n" "You must enter a valid SYSTEM name."
help_message help_message
exit 0 exit 0
fi fi
# variables ## colors
#readonly COLOR_BLACK=$(tput setaf 0)
#readonly COLOR_RED=$(tput setaf 1)
#readonly COLOR_GREEN=$(tput setaf 2)
#readonly COLOR_YELLOW=$(tput setaf 3)
#readonly COLOR_BLUE=$(tput setaf 4)
#readonly COLOR_MAGENTA=$(tput setaf 5)
#readonly COLOR_CYAN=$(tput setaf 6)
readonly COLOR_WHITE=$(tput setaf 7) readonly COLOR_WHITE=$(tput setaf 7)
#readonly COLOR_BACKGROUND_BLACK=$(tput setab 0)
readonly COLOR_BACKGROUND_RED=$(tput setab 1) readonly COLOR_BACKGROUND_RED=$(tput setab 1)
#readonly COLOR_BACKGROUND_GREEN=$(tput setab 2)
#readonly COLOR_BACKGROUND_YELLOW=$(tput setab 3)
#readonly COLOR_BACKGROUND_BLUE=$(tput setab 4)
#readonly COLOR_BACKGROUND_MAGENTA=$(tput setab 5)
#readonly COLOR_BACKGROUND_CYAN=$(tput setab 6)
#readonly COLOR_BACKGROUND_WHITE=$(tput setab 7)
readonly RESET_COLOR=$(tput sgr0) readonly RESET_COLOR=$(tput sgr0)
## variables
#readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" #readonly SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
readonly ROM_DIR="$2" readonly ROM_DIR="$2"
readonly SYSTEM_NAME="$3" readonly SYSTEM_NAME="$3"
readonly FRONTEND="emulationstation" readonly FRONTEND="emulationstation"
readonly CONSOLE_ART=artwork.xml.retroarch ## artwork
readonly ARCADE_ART=artwork.xml.retroarch readonly CONSOLE_ART=artwork.xml.cover
readonly ARCADE_ART=artwork.xml.cover
## scrapers
readonly CONSOLE_SCRAPERS="screenscraper mobygames thegamesdb" readonly CONSOLE_SCRAPERS="screenscraper mobygames thegamesdb"
readonly ARCADE_SCRAPERS="screenacraper arcadedb" readonly ARCADE_SCRAPERS="screenacraper arcadedb"
readonly BUILD_FLAGS_CONSOLE="unattend,forcefilename,relative" ## flags
readonly BUILD_FLAGS_ARCADE="unattend,relative" readonly BUILD_FLAGS_CONSOLE="videos,unattend,forcefilename,relative"
readonly BUILD_FLAGS_ARCADE="videos,unattend,relative"
## systems
readonly CONSOLE="3do 3ds amiga amstradcpc apple2 arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fds gameandwatch gamegear gb gba gbc gc genesis intellivision mastersystem megacd megadrive msx n64 nds nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum" readonly CONSOLE="3do 3ds amiga amstradcpc apple2 arcadia astrocde atari800 atari2600 atari5200 atari7800 atarijaguar atarilynx atarist c16 c64 c128 coco coleco daphne dragon32 dreamcast fds gameandwatch gamegear gb gba gbc gc genesis intellivision mastersystem megacd megadrive msx n64 nds nes ngp ngpc oric pc pc88 pc98 pcfx pcengine pokemini ports ps2 psp psx saturn scummvm sega32x segacd sg-1000 snes ti99 trs-80 vectrex vic20 videopac virtualboy wii wonderswan wonderswancolor x68000 x1 zmachine zx81 zxspectrum"
readonly ARCADE="arcade fba neogeo mame-advmame mame-mame4all" readonly ARCADE="arcade fba neogeo mame-advmame mame-mame4all"
SCRAP=true
BUILD=true
if [ "$1" = scrap ] || [ "$1" = SCRAP ]; then if [ "$1" = scrap ] || [ "$1" = SCRAP ]; then
BUILD=false BUILD=false
SCRAP = true
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP ONLY ${RESET_COLOR}" printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP ONLY ${RESET_COLOR}"
sleep 1 sleep 1
fi fi
if [ "$1" = build ] || [ "$1" = BUILD ]; then if [ "$1" = build ] || [ "$1" = BUILD ]; then
BUILD = true
SCRAP=false SCRAP=false
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## BUILD ONLY ${RESET_COLOR}" printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## BUILD ONLY ${RESET_COLOR}"
sleep 1 sleep 1
@@ -82,11 +73,11 @@ fi
if echo "${CONSOLE}" | grep -w "${SYSTEM_NAME}" >/dev/null; then if echo "${CONSOLE}" | grep -w "${SYSTEM_NAME}" >/dev/null; then
if [ "${SCRAP}" = true ]; then if [ "${SCRAP}" = true ]; then
for SCRAPER in ${CONSOLE_SCRAPERS}; do for SCRAPER in ${CONSOLE_SCRAPERS}; do
Skyscraper --flags videos,unattend,noresize,unpack -p "${SYSTEM_NAME}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM_NAME}" $APP --flags videos,unattend,noresize,unpack -p "${SYSTEM_NAME}" -s "${SCRAPER}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
done done
fi fi
if [ "${BUILD}" = true ]; then if [ "${BUILD}" = true ]; then
Skyscraper --flags "${BUILD_FLAGS_CONSOLE}" -a $CONSOLE_ART -p "${SYSTEM_NAME}" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM_NAME}" $APP --flags "${BUILD_FLAGS_CONSOLE}" -a $CONSOLE_ART -p "${SYSTEM_NAME}" -f "${FRONTEND}" -i "${ROM_DIR}"/"${SYSTEM_NAME}"
fi fi
exit 0 exit 0
fi fi