mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-25 07:25:38 +00:00
RUN_GAME: working but looping - fix
This commit is contained in:
parent
38806dabc1
commit
d0644c82e6
|
@ -981,9 +981,10 @@ run_game() {
|
|||
log d "Game: \"$game\""
|
||||
log d "System: \"$system\""
|
||||
|
||||
# Function to handle the %INJECT% placeholder
|
||||
handle_inject_placeholder() {
|
||||
# Function to handle the %INJECT% placeholder
|
||||
handle_inject_placeholder() {
|
||||
local cmd="$1"
|
||||
local rom_dir=$(dirname "$game") # Define rom_dir based on the game path
|
||||
|
||||
# Find all occurrences of %INJECT%=something
|
||||
while [[ "$cmd" =~ %INJECT%=(.*) ]]; do
|
||||
|
@ -994,7 +995,7 @@ run_game() {
|
|||
|
||||
log d "Found %INJECT% pointing to file \"$inject_file_full_path\""
|
||||
|
||||
# Check if the file exists
|
||||
# Check if the file exists (no escaping needed, just quotes)
|
||||
if [[ -f "$inject_file_full_path" ]]; then
|
||||
# Read the content of the file
|
||||
inject_content=$(cat "$inject_file_full_path")
|
||||
|
@ -1011,7 +1012,11 @@ run_game() {
|
|||
|
||||
log d "Returning the command with injected content: $cmd"
|
||||
echo "$cmd"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Function to replace %EMULATOR_SOMETHING% with the actual path of the emulator
|
||||
replace_emulator_placeholder() {
|
||||
|
|
Loading…
Reference in a new issue