mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 05:55:38 +00:00
RUN_GAME: fixed retroarch
This commit is contained in:
parent
36b7ee6cdc
commit
0cafedbe70
|
@ -952,16 +952,22 @@ run_game() {
|
|||
if [[ "$emulator" == *"_libretro" ]]; then
|
||||
local core_path="/var/config/retroarch/cores/$emulator.so"
|
||||
log d "Running RetroArch core: $core_path"
|
||||
log d "Command: retroarch -L $core_path \"$game\""
|
||||
eval "retroarch -L $core_path \"$game\""
|
||||
else
|
||||
# Parse emulator launch command and arguments from the JSON file
|
||||
# Parse emulator launch command and optional arguments from the JSON file
|
||||
local launch_command=$(jq -r ".emulator.$emulator.launch" "$features")
|
||||
local launch_args=$(jq -r ".emulator.$emulator.\"launch-args\"" "$features")
|
||||
|
||||
# Replace $game in launch_args with the actual game path, quoting it to handle spaces
|
||||
launch_args=${launch_args//\$game/\"$game\"}
|
||||
|
||||
# Form and execute the command
|
||||
eval "$launch_command $launch_args"
|
||||
# Only add launch_args if they are not null
|
||||
if [[ "$launch_args" != "null" ]]; then
|
||||
# Replace $game in launch_args with the actual game path, quoting it to handle spaces
|
||||
launch_args=${launch_args//\$game/\"$game\"}
|
||||
log d "Command: \"$launch_command $launch_args\""
|
||||
eval "$launch_command $launch_args"
|
||||
else
|
||||
log d "Command: \"$launch_command\""
|
||||
eval "$launch_command \"$game\""
|
||||
fi
|
||||
fi
|
||||
}
|
Loading…
Reference in a new issue