From 54d37425752154995b721f912727ca7d3fa9c766 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Wed, 24 Jan 2024 17:40:18 +0100 Subject: [PATCH] HELPER_FILES: get them from the wiki --- .../reference_lists/helper_files_list.cfg | 36 ++++++++-------- functions/functions.sh | 43 +++++++++++++++---- 2 files changed, 54 insertions(+), 25 deletions(-) diff --git a/emu-configs/defaults/retrodeck/reference_lists/helper_files_list.cfg b/emu-configs/defaults/retrodeck/reference_lists/helper_files_list.cfg index 8a3b9744..1e1e68b7 100644 --- a/emu-configs/defaults/retrodeck/reference_lists/helper_files_list.cfg +++ b/emu-configs/defaults/retrodeck/reference_lists/helper_files_list.cfg @@ -4,21 +4,23 @@ # The FILE name can have spaces in it, but the DESTINATION cannot, even in variable form # mods -how-to-install-citra-mods.txt^$mods_folder/Citra -how-to-install-dolphin-mods.txt^$mods_folder/Dolphin -how-to-install-primehack-mods.txt^$mods_folder/Primehack -how-to-install-yuzu-mods.txt^$mods_folder/Yuzu +https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/citra/citra-texture-pack/^$mods_folder/Citra -# textures -how-to-install-Mesen-textures.txt^$texture_packs_folder/RetroArch-Mesen -how-to-install-PPSSPP-textures.txt^$texture_packs_folder/PPSSPP -how-to-install-PCSX2-textures.txt^$texture_packs_folder/PCSX2 -how-to-install-Mupen64Plus-textures.txt^$texture_packs_folder/RetroArch-Mupen64Plus/cache -how-to-install-Mupen64Plus-textures.txt^$texture_packs_folder/RetroArch-Mupen64Plus/hires_texture -how-to-install-Duckstation-textures.txt^$texture_packs_folder/Duckstation - -# customs -how-to-install-custom-emulators.txt^$rdhome/customs - -# emulators -how-to-install-psvita-games.txt^$roms_folder/psvita +# TODO: fi it's working populate this +# how-to-install-dolphin-mods.txt^$mods_folder/Dolphin +# how-to-install-primehack-mods.txt^$mods_folder/Primehack +# how-to-install-yuzu-mods.txt^$mods_folder/Yuzu +# +# # textures +# how-to-install-Mesen-textures.txt^$texture_packs_folder/RetroArch-Mesen +# how-to-install-PPSSPP-textures.txt^$texture_packs_folder/PPSSPP +# how-to-install-PCSX2-textures.txt^$texture_packs_folder/PCSX2 +# how-to-install-Mupen64Plus-textures.txt^$texture_packs_folder/RetroArch-Mupen64Plus/cache +# how-to-install-Mupen64Plus-textures.txt^$texture_packs_folder/RetroArch-Mupen64Plus/hires_texture +# how-to-install-Duckstation-textures.txt^$texture_packs_folder/Duckstation +# +# # customs +# how-to-install-custom-emulators.txt^$rdhome/customs +# +# # emulators +# how-to-install-psvita-games.txt^$roms_folder/psvita diff --git a/functions/functions.sh b/functions/functions.sh index 3b3719fb..09fb2fec 100644 --- a/functions/functions.sh +++ b/functions/functions.sh @@ -490,16 +490,43 @@ update_splashscreens() { deploy_helper_files() { # This script will distribute helper documentation files throughout the filesystem according to the $helper_files_list - # USAGE: deploy_helper_files + # USAGE: 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 + local file_path=$1 + local wiki_link + local destination_path + local wiki_url="https://github.com/XargonWan/RetroDECK-Wiki" + local link_content + local wiki_path="/tmp/wiki" - done < "$helper_files_list" + # Check if the file exists + if [ ! -f "$file_path" ]; then + echo "Error: File not found: $file_path" + return 1 + fi + + # Read parameters from the file + IFS='^' read -r wiki_link destination_path < "$file_path" + + # Check if the repository is already cloned + if [ ! -d "$wiki_path" ]; then + # Clone the repository + git clone "$wiki_url" "$wiki_path" + fi + + # Change to the destination path and pull the latest changes + cd "$wiki_path" || return + git pull origin main + + # Copy the wiki_link file to the destination path + cp "$wiki_link" "$destination_path" + + # Append the link content to the end of the file + link_content="Related wiki article can be found here:\n$wiki_link\n\nThe RetroDECK Team" + echo -e "$link_content" >> "$destination_path" + + # Return to the original directory if needed + cd - || return } easter_eggs() {