HELPER_FILES: get them from the wiki

This commit is contained in:
XargonWan 2024-01-24 17:40:18 +01:00
parent 6b86d79d74
commit 54d3742575
2 changed files with 54 additions and 25 deletions

View file

@ -4,21 +4,23 @@
# The FILE name can have spaces in it, but the DESTINATION cannot, even in variable form # The FILE name can have spaces in it, but the DESTINATION cannot, even in variable form
# mods # mods
how-to-install-citra-mods.txt^$mods_folder/Citra https://retrodeck.readthedocs.io/en/latest/wiki_emulator_guides/citra/citra-texture-pack/^$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
# textures # TODO: fi it's working populate this
how-to-install-Mesen-textures.txt^$texture_packs_folder/RetroArch-Mesen # how-to-install-dolphin-mods.txt^$mods_folder/Dolphin
how-to-install-PPSSPP-textures.txt^$texture_packs_folder/PPSSPP # how-to-install-primehack-mods.txt^$mods_folder/Primehack
how-to-install-PCSX2-textures.txt^$texture_packs_folder/PCSX2 # how-to-install-yuzu-mods.txt^$mods_folder/Yuzu
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 # # textures
how-to-install-Duckstation-textures.txt^$texture_packs_folder/Duckstation # how-to-install-Mesen-textures.txt^$texture_packs_folder/RetroArch-Mesen
# how-to-install-PPSSPP-textures.txt^$texture_packs_folder/PPSSPP
# customs # how-to-install-PCSX2-textures.txt^$texture_packs_folder/PCSX2
how-to-install-custom-emulators.txt^$rdhome/customs # 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
# emulators # how-to-install-Duckstation-textures.txt^$texture_packs_folder/Duckstation
how-to-install-psvita-games.txt^$roms_folder/psvita #
# # customs
# how-to-install-custom-emulators.txt^$rdhome/customs
#
# # emulators
# how-to-install-psvita-games.txt^$roms_folder/psvita

View file

@ -490,16 +490,43 @@ update_splashscreens() {
deploy_helper_files() { deploy_helper_files() {
# This script will distribute helper documentation files throughout the filesystem according to the $helper_files_list # This script will distribute helper documentation files throughout the filesystem according to the $helper_files_list
# USAGE: deploy_helper_files # USAGE: deploy_helper_files <file_path>
while IFS='^' read -r file dest local file_path=$1
do local wiki_link
if [[ ! "$file" == "#"* ]] && [[ ! -z "$file" ]]; then local destination_path
eval current_dest="$dest" local wiki_url="https://github.com/XargonWan/RetroDECK-Wiki"
cp -f "$helper_files_folder/$file" "$current_dest/$file" local link_content
local wiki_path="/tmp/wiki"
# Check if the file exists
if [ ! -f "$file_path" ]; then
echo "Error: File not found: $file_path"
return 1
fi fi
done < "$helper_files_list" # 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() { easter_eggs() {