diff --git a/emu-configs/defaults/retrodeck/reference_lists/helper_files_list.cfg b/emu-configs/defaults/retrodeck/reference_lists/helper_files_list.cfg new file mode 100644 index 00000000..d5a1be95 --- /dev/null +++ b/emu-configs/defaults/retrodeck/reference_lists/helper_files_list.cfg @@ -0,0 +1,5 @@ +# The proper format of this file is +# FILE NAME^DESTINATION +# The destination can be an internal variable name like $roms_folder if needed +# The FILE name can have spaces in it, but the DESTINATION cannot, even in variable form +RetroDECK Example Readme.txt^$rdhome diff --git a/functions.sh b/functions.sh index f5b977e1..b9dbb3c9 100644 --- a/functions.sh +++ b/functions.sh @@ -1061,7 +1061,7 @@ conf_write() { while IFS= read -r current_setting_line # Read the existing retrodeck.cfg do - if [[ (! -z "$current_setting_line") && (! "$current_setting_line" == "#!/bin/bash") && (! "$current_setting_line" == "[]") ]]; then # If the line has a valid entry in it + if [[ (! -z "$current_setting_line") && (! "$current_setting_line" == "#"*) && (! "$current_setting_line" == "[]") ]]; then # If the line has a valid entry in it if [[ ! -z $(grep -o -P "^\[.+?\]$" <<< "$current_setting_line") ]]; then # If the line is a section header current_section=$(sed 's^[][]^^g' <<< $current_setting_line) # Remove brackets from section name else @@ -1082,7 +1082,7 @@ conf_read() { while IFS= read -r current_setting_line # Read the existing retrodeck.cfg do - if [[ (! -z "$current_setting_line") && (! "$current_setting_line" == "#!/bin/bash") && (! "$current_setting_line" == "[]") ]]; then # If the line has a valid entry in it + if [[ (! -z "$current_setting_line") && (! "$current_setting_line" == "#"*) && (! "$current_setting_line" == "[]") ]]; then # If the line has a valid entry in it if [[ ! -z $(grep -o -P "^\[.+?\]$" <<< "$current_setting_line") ]]; then # If the line is a section header current_section=$(sed 's^[][]^^g' <<< $current_setting_line) # Remove brackets from section name else @@ -1171,6 +1171,18 @@ update_splashscreens() { cp -rf /app/retrodeck/graphics/* /var/config/emulationstation/.emulationstation/resources/graphics } +deploy_helper_files() { + +while IFS='^' read -r file dest +do + if [[ ! "$file" == "#"* ]] && [[ ! -z "$file" ]]; then + eval current_dest="$dest" + cp -f "$helper_files_folder/$file" "$current_dest/$file" + fi + +done < "$helper_files_list" +} + prepare_emulator() { # This function will perform one of several actions on one or more emulators # The actions currently include "reset" and "postmove" diff --git a/global.sh b/global.sh index 95220670..3a903232 100755 --- a/global.sh +++ b/global.sh @@ -28,6 +28,8 @@ hard_version="$(cat '/app/retrodeck/version')" rd_repo="https://github.com/XargonWan/RetroDECK" # The URL of the main RetroDECK GitHub repo es_themes_list="https://gitlab.com/es-de/themes/themes-list/-/raw/master/themes.json" # The URL of the ES-DE 2.0 themes list remote_network_target="https://one.one.one.one" # The URL of a common internet target for testing network access +helper_files_folder="$emuconfigs/defaults/retrodeck/helper_files" # The parent folder of RetroDECK documentation files for deployment +helper_files_list="$emuconfigs/defaults/retrodeck/reference_lists/helper_files_list.cfg" # The list of files to be deployed and where they go rpcs3_firmware="http://dus01.ps3.update.playstation.net/update/ps3/image/us/2023_0228_05fe32f5dc8c78acbcd84d36ee7fdc5b/PS3UPDAT.PUP" # Config files for emulators with single config files