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
+19 -115
View File
@@ -1,4 +1,6 @@
#!/bin/bash
## usage
readonly USAGE="
USAGE:
$(basename "$0") [BUILD | SCRAP | BOTH] [FRONTEND] [PATH]"
@@ -12,65 +14,53 @@ function help_message() {
done
}
FRONTENDS="emulationstation pegasus"
# check if there are all the parameters
## check if there are all the parameters
if [ "$#" -ne 3 ]; then
help_message
exit 0
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
printf "%s\n" "You must enter a valid FRONTEND name."
help_message
exit 0
fi
# variables
#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)"
## parameters
readonly FRONTEND="$2"
readonly ROM_DIR="$3"
readonly CONSOLE_ART=artwork.xml.rgbpi
readonly ARCADE_ART=artwork.xml.rgbpi
## colors
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 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"
#readonly BUILD_FLAGS_ARCADE="videos,unattend,relative,nobrackets,skipexistingcovers,skipexistingmarquees,skipexistingscreenshots,skipexistingvideos,skipexistingwheels"
readonly BUILD_FLAGS_ARCADE="videos,unattend,relative"
SCRAP=true
BUILD=true
## check if BUID, SCRAP or BOTH
if [ "$1" = scrap ] || [ "$1" = SCRAP ]; then
BUILD=false
SCRAP=true
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## SCRAP ONLY ${RESET_COLOR}"
sleep 1
fi
if [ "$1" = build ] || [ "$1" = BUILD ]; then
BUILD=true
SCRAP=false
printf "%s\n" "${COLOR_WHITE}${COLOR_BACKGROUND_RED}## BUILD ONLY ${RESET_COLOR}"
sleep 1
@@ -141,89 +131,3 @@ fi
## 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' {} \;
## 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