mirror of
https://github.com/dragoonDorise/EmuDeck.git
synced 2024-05-20 13:17:55 -04:00
Compare commits
3 commits
ac56cd3c66
...
48e07bfc1f
Author | SHA1 | Date | |
---|---|---|---|
48e07bfc1f | |||
c49a0eb284 | |||
69a5c9a98e |
|
@ -1,20 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
BINUP_toolName="EmuDeck Tool Updater"
|
||||
BINUP_toolName="EmuDeck AppImage Updater"
|
||||
BINUP_toolType="script"
|
||||
BINUP_toolPath="${toolsPath}/binupdate/binupdate.sh"
|
||||
BINUP_Shortcutlocation="$HOME/Desktop/EmuDeckBinUpdate.desktop"
|
||||
|
||||
|
||||
|
||||
BINUP_install(){
|
||||
|
||||
BINUP_install(){
|
||||
|
||||
rsync -avhp --mkpath "$EMUDECKGIT/tools/binupdate" "$toolsPath/"
|
||||
|
||||
chmod +x "$BINUP_toolPath"
|
||||
#update the paths in the script
|
||||
sed -i "s|/run/media/mmcblk0p1/Emulation/roms|${romsPath}|g" "$BINUP_toolPath"
|
||||
sed -i "s|/run/media/mmcblk0p1/Emulation/tools|${toolsPath}|g" "$BINUP_toolPath"
|
||||
sed -i "s|/run/media/mmcblk0p1/Emulation/tools|${toolsPath}|g" "$BINUP_toolPath"
|
||||
|
||||
#createDesktopShortcut "$BINUP_Shortcutlocation" "$BINUP_toolName" "bash $BINUP_toolPath" "True"
|
||||
}
|
||||
|
|
19
functions/ToolScripts/emuDeckFlatpakUP.sh
Normal file
19
functions/ToolScripts/emuDeckFlatpakUP.sh
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
FlatpakUP_toolName="EmuDeck Flatpak Updater"
|
||||
FlatpakUP_toolType="script"
|
||||
FlatpakUP_toolPath="${toolsPath}/flatpakupdate/flatpakupdate.sh"
|
||||
|
||||
|
||||
|
||||
FlatpakUp_install(){
|
||||
|
||||
rsync -avhp --mkpath "$EMUDECKGIT/tools/flatpakupdate" "$toolsPath/"
|
||||
|
||||
chmod +x "$FlatpakUP_toolPath"
|
||||
#update the paths in the script
|
||||
sed -i "s|/run/media/mmcblk0p1/Emulation/roms|${romsPath}|g" "$FlatpakUP_toolPath"
|
||||
sed -i "s|/run/media/mmcblk0p1/Emulation/tools|${toolsPath}|g" "$FlatpakUP_toolPath"
|
||||
|
||||
#createDesktopShortcut "$FlatpakUP_Shortcutlocation" "$FlatpakUP_toolName" "bash $FlatpakUP_toolPath" "True"
|
||||
}
|
|
@ -45,6 +45,7 @@ source "$EMUDECKGIT"/functions/createFolders.sh
|
|||
source "$EMUDECKGIT"/functions/runSRM.sh
|
||||
source "$EMUDECKGIT"/functions/appImageInit.sh
|
||||
source "$EMUDECKGIT"/functions/autofix.sh
|
||||
source "$EMUDECKGIT"/functions/generateGameLists.sh
|
||||
|
||||
|
||||
#toolScripts
|
||||
|
@ -54,6 +55,7 @@ source "$EMUDECKGIT"/functions/ToolScripts/emuDeckPlugins.sh
|
|||
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckSRM.sh
|
||||
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckCHD.sh
|
||||
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckBINUP.sh
|
||||
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckFlatpakUP.sh
|
||||
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckCloudBackup.sh
|
||||
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckCloudSync.sh
|
||||
source "$EMUDECKGIT"/functions/ToolScripts/emuDeckRemotePlayWhatever.sh
|
||||
|
|
61
functions/generateGameLists.sh
Normal file
61
functions/generateGameLists.sh
Normal file
|
@ -0,0 +1,61 @@
|
|||
#!/bin/bash
|
||||
|
||||
generateGameLists(){
|
||||
|
||||
ROMS_DIR="$romsPath"
|
||||
|
||||
JSON_OUTPUT="$HOME/emudeck/roms_games.json"
|
||||
echo "[" > "$JSON_OUTPUT"
|
||||
|
||||
for system_dir in "$ROMS_DIR"/*; do
|
||||
if [[ -d "$system_dir" && -f "$system_dir/metadata.txt" ]]; then
|
||||
|
||||
collection=$(grep 'collection:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | awk '{$1=$1};1')
|
||||
shortname=$(grep 'shortname:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | awk '{$1=$1};1')
|
||||
extensions=$(grep 'extensions:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | tr ',' '\n' | awk '{$1=$1};1' | tr '\n' '|')
|
||||
launcher=$(grep 'launch:' "$system_dir/metadata.txt" | cut -d ':' -f 2- | awk '{$1=$1};1')
|
||||
extensions="${extensions%|}" # Eliminar el último '|'
|
||||
|
||||
|
||||
tmp_file="$(mktemp)"
|
||||
|
||||
|
||||
find "$system_dir" -type f | while read file_path; do
|
||||
filename=$(basename "$file_path")
|
||||
extension="${filename##*.}"
|
||||
|
||||
if [[ $extensions =~ (^|[|])${extension,,}([|]|$) ]]; then
|
||||
|
||||
name="${filename%.*}"
|
||||
echo "{\"name\": \"$name\", \"filename\": \"$file_path\"}," >> "$tmp_file"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
sort "$tmp_file" | sed '$ s/,$//' > "${tmp_file}_sorted"
|
||||
mv "${tmp_file}_sorted" "$tmp_file"
|
||||
|
||||
|
||||
if [[ -s "$tmp_file" ]]; then
|
||||
echo " {" >> "$JSON_OUTPUT"
|
||||
echo " \"title\": \"$collection\"," >> "$JSON_OUTPUT"
|
||||
echo " \"id\": \"$shortname\"," >> "$JSON_OUTPUT"
|
||||
echo " \"launcher\": \"$launcher\"," >> "$JSON_OUTPUT"
|
||||
echo " \"games\": [" >> "$JSON_OUTPUT"
|
||||
cat "$tmp_file" >> "$JSON_OUTPUT"
|
||||
echo " ]" >> "$JSON_OUTPUT"
|
||||
echo " }," >> "$JSON_OUTPUT"
|
||||
fi
|
||||
|
||||
|
||||
rm "$tmp_file"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
echo "]" >> "$JSON_OUTPUT"
|
||||
sed -i '$ s/,$//' "$JSON_OUTPUT"
|
||||
|
||||
cat $JSON_OUTPUT
|
||||
|
||||
}
|
Loading…
Reference in a new issue