Add game scanner for Raze/Build engine games to JELOS

This commit is contained in:
travis134 2022-08-17 23:54:03 -07:00
parent 972780dbd0
commit d522efa167
No known key found for this signature in database
GPG key ID: FB8B9EEA5CEF2984
2 changed files with 26 additions and 1 deletions

View file

@ -0,0 +1,25 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2022-present travis134
. /etc/profile
RAZEPATH="/storage/roms/build"
clear >/dev/console
echo "Scanning for games..." >/dev/console
grp_files=$(find "${RAZEPATH}" -type f -iname "*.grp")
echo "Adding games..." >/dev/console
while read -r grp_file; do
path=$(dirname "${grp_file}")
grp=$(basename "${grp_file}")
file="${RAZEPATH}/${grp%.*}.build"
cat >"${file}" <<-EOM
PATH=${path#"$RAZEPATH/"}
GRP=${grp}
-- end --
EOM
done <<<"${grp_files}"
systemctl restart emustation
clear >/dev/console

View file

@ -40,7 +40,7 @@ if [ ${EXT} == "build" ]; then
done < "${1}" done < "${1}"
fi fi
if [[ ! "RUN_DIR" == "/storage/roms/build" ]]; then if [[ ! "$RUN_DIR" == "/storage/roms/build" ]]; then
cd "${RUN_DIR}" cd "${RUN_DIR}"
/usr/bin/raze ${params} >/var/log/raze.log 2>&1 /usr/bin/raze ${params} >/var/log/raze.log 2>&1
fi fi