Created
June 9, 2019 14:07
-
-
Save i30817/50606b085aa6dff466fb76223e231a7e to your computer and use it in GitHub Desktop.
script to update romhacks dats using rhdnet and merging to a existing file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#cd to the script dir if executed from outside | |
SCRIPT_PATH=$(dirname "$(readlink -f "$0")") | |
cd "$SCRIPT_PATH" | |
if [ ! -t 1 ]; then #not from terminal | |
SCRIPT=$(basename "$(readlink -f "$0")") | |
SUBPROC=1 x-terminal-emulator --profile "$USER" --working-directory "$SCRIPT_PATH" -e "./$SCRIPT" & | |
exit 0 | |
fi | |
#pypi path which because of a bug sometimes isn't on the path | |
if [ -d "$HOME/.local/bin" ] ; then | |
PATH="$HOME/.local/bin:$PATH" | |
fi | |
hash rhdndat 2>/dev/null || { echo >&2 "Program requires rhdndat but it's not installed. Aborting."; exit 1; } | |
DATS=/media/i30817/backup/Documents/Games/dats | |
GAMES=/media/i30817/backup/Documents/Games | |
OUT=/media/i30817/backup/Documents/projects/libretro-database/metadat/hacks | |
OUT2=/media/i30817/backup/Documents/projects/libretro-database/dat | |
#SYS="Adventure Game Studio"; rhdndat "$GAMES/$SYS" "exe" -o "$OUT2/$SYS.dat" | |
SYS="SNK - Neo Geo Pocket Color"; rhdndat -d "$DATS/ngc.xml" "$GAMES/$SYS" "ngc" -o "$OUT/$SYS.dat" | |
SYS="Bandai - WonderSwan"; rhdndat -d "$DATS/ws.xml" "$GAMES/$SYS" "ws" -o "$OUT/$SYS.dat" | |
SYS="Bandai - WonderSwan Color"; rhdndat -d "$DATS/wsc.xml" "$GAMES/$SYS" "wsc" -o "$OUT/$SYS.dat" | |
SYS="NEC - PC Engine - TurboGrafx 16"; rhdndat -d "$DATS/pce.xml" "$GAMES/$SYS" "pce" -o "$OUT/$SYS.dat" | |
SYS="Nintendo - Game Boy"; rhdndat -d "$DATS/gb.xml" "$GAMES/$SYS" "gb" -o "$OUT/$SYS.dat" | |
SYS="Nintendo - Game Boy Advance"; rhdndat -d "$DATS/gba.xml" "$GAMES/$SYS" "gba" -o "$OUT/$SYS.dat" | |
SYS="Nintendo - Game Boy Color"; rhdndat -d "$DATS/gbc.xml" "$GAMES/$SYS" "gbc" -o "$OUT/$SYS.dat" | |
SYS="Nintendo - Nintendo 64"; rhdndat -d "$DATS/n64.xml" "$GAMES/$SYS" "n64" -o "$OUT/$SYS.dat" | |
SYS="Nintendo - Nintendo 64"; rhdndat -d "$DATS/n64.xml" "$GAMES/$SYS" "v64" -o "$OUT/$SYS.dat" | |
SYS="Nintendo - Nintendo 64"; rhdndat -d "$DATS/n64.xml" "$GAMES/$SYS" "z64" -o "$OUT/$SYS.dat" | |
SYS="Nintendo - Nintendo DS"; rhdndat -d "$DATS/nds.xml" "$GAMES/$SYS" "nds" -o "$OUT/$SYS.dat" | |
#SYS="Nintendo - Nintendo Entertainment System"; rhdndat -d "$DATS/nes.xml" "$GAMES/$SYS" "nes" -o "$OUT/$SYS.dat" | |
#SYS="Nintendo - Super Nintendo Entertainment System"; rhdndat -d "$DATS/snes.xml" "$GAMES/$SYS" "sfc" -o "$OUT/$SYS.dat" | |
SYS="Sega - Game Gear"; rhdndat -d "$DATS/sgg.xml" "$GAMES/$SYS" "gg" -o "$OUT/$SYS.dat" | |
SYS="Sega - Master System - Mark III"; rhdndat -d "$DATS/sms.xml" "$GAMES/$SYS" "sms" -o "$OUT/$SYS.dat" | |
SYS="Sega - Mega Drive - Genesis"; rhdndat -d "$DATS/gen.xml" "$GAMES/$SYS" "md" -o "$OUT/$SYS.dat" | |
SYS="Sega - 32x"; rhdndat -d "$DATS/32x.xml" "$GAMES/$SYS" "32x" -o "$OUT/$SYS.dat" | |
SYS="Sega - Saturn"; rhdndat -d "$DATS/sat.xml" "$GAMES/$SYS" "bin" -o "$OUT/$SYS.dat" | |
SYS="Sony - PlayStation"; rhdndat -d "$DATS/ps1.xml" "$GAMES/$SYS" "bin" -o "$OUT/$SYS.dat" | |
SYS="Sony - PlayStation Portable"; rhdndat -d "$DATS/psp.xml" "$GAMES/$SYS" "iso" -o "$OUT/$SYS.dat" | |
SYS="Sony - PlayStation 2"; rhdndat -d "$DATS/ps2.xml" "$GAMES/$SYS" "iso" -o "$OUT/$SYS.dat" | |
#keep terminal open if subprocess started to show output | |
#indicated by SUBPROC being set | |
[[ -v SUBPROC ]] && read -p "Press any key to exit" -n1 junk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment