Permalink
Browse files

Merge pull request #2474 from joolswills/addPort_custom_script

addPort - remove script parameter and handle in scriptmodule
  • Loading branch information...
joolswills committed Aug 24, 2018
2 parents d6c0e4b + c86f0e8 commit 8fa87a181598c366f100a746c2aa9fb117af43c3
Showing with 7 additions and 11 deletions.
  1. +1 −9 scriptmodules/helpers.sh
  2. +6 −2 scriptmodules/libretrocores/lr-nxengine.sh
View
@@ -1147,12 +1147,9 @@ function delSystem() {
## @param name display name for the launch script
## @param cmd commandline to launch
## @param game rom/game parameter (optional)
## @param script launch script to use instead of the default (optional - requires game to be set)
## @brief Adds a port to the emulationstation ports menu.
## @details Adds an emulators.cfg entry as with addSystem but also creates a launch script in `$datadir/ports/$name.sh`.
##
## Can optionally take a script via stdin to use instead of the default launch script.
##
## Can also optionally take a game parameter which can be used to create multiple launch
## scripts for different games using the same engine - eg for quake
##
@@ -1167,7 +1164,6 @@ function addPort() {
local file="$romdir/ports/$3.sh"
local cmd="$4"
local game="$5"
local script="$6"
# move configurations from old ports location
if [[ -d "$configdir/$port" ]]; then
@@ -1187,14 +1183,10 @@ function addPort() {
mkUserDir "$romdir/ports"
if [[ -z "$script" ]]; then
cat >"$file" << _EOF_
cat >"$file" << _EOF_
#!/bin/bash
"$rootdir/supplementary/runcommand/runcommand.sh" 0 _PORT_ "$port" "$game"
_EOF_
else
cat >"$file" <<< "$script"
fi
chown $user:$user "$file"
chmod +x "$file"
@@ -35,15 +35,19 @@ function configure_lr-nxengine() {
local script
setConfigRoot "ports"
read -r -d "" script << _EOF_
addPort "$md_id" "cavestory" "Cave Story" "$md_inst/nxengine_libretro.so"
local file="$romdir/ports/Cave Story.sh"
# custom launch script - if the data files are not found, warn the user
cat >"$file" << _EOF_
#!/bin/bash
if [[ ! -f "$romdir/ports/CaveStory/Doukutsu.exe" ]]; then
dialog --no-cancel --pause "$md_help" 22 76 15
else
"$rootdir/supplementary/runcommand/runcommand.sh" 0 _PORT_ cavestory "$romdir/ports/CaveStory/Doukutsu.exe"
fi
_EOF_
addPort "$md_id" "cavestory" "Cave Story" "$md_inst/nxengine_libretro.so" "" "$script"
chown $user:$user "$file"
chmod +x "$file"
ensureSystemretroconfig "ports/cavestory"
}

0 comments on commit 8fa87a1

Please sign in to comment.