mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-02-16 19:35:39 +00:00
PONZU: function refactor
This commit is contained in:
parent
10e6520644
commit
9e894733ff
|
@ -658,41 +658,32 @@ manage_ryujinx_keys() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ponzu() {
|
ponzu() {
|
||||||
|
|
||||||
local tmp_folder="/tmp/extracted"
|
|
||||||
|
|
||||||
# This function is used to extract some specific appimages
|
# This function is used to extract some specific appimages
|
||||||
# Check if any of the specified files exist
|
# Check if any of the specified files exist
|
||||||
if kiroi_ponzu=$(ls "$rdhome"/ponzu/Citra*.AppImage 1> /dev/null 2>&1) \
|
|
||||||
|| kiroi_ponzu=$(ls "$rdhome"/citra*.AppImage 1> /dev/null 2>&1) ; then
|
|
||||||
log i "Found kiroi ponzu! Elaborating it"
|
|
||||||
local data_dir="/var/data/Citra"
|
|
||||||
local appimage="$kiroi_ponzu"
|
|
||||||
create_dir "$data_dir"
|
|
||||||
log d "Moving AppImage in \"$data_dir\""
|
|
||||||
mv "$appimage" "$data_dir"
|
|
||||||
cd "$data_dir"
|
|
||||||
chmod +x "$appimage"
|
|
||||||
log d "Extracting AppImage"
|
|
||||||
"$appimage" --appimage-extract
|
|
||||||
create_dir "$tmp_folder"
|
|
||||||
log d "Cleaning up"
|
|
||||||
cp -r squashfs-root/* "$tmp_folder"
|
|
||||||
rm -rf *
|
|
||||||
mv "$tmp_folder/"** .
|
|
||||||
local executable=""
|
|
||||||
log d "Making $executable executable"
|
|
||||||
chmod +x "$executable"
|
|
||||||
cd -
|
|
||||||
log i "Kiroi ponzu is served, enjoy"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if any of the specified files exist
|
local tmp_folder="/tmp/extracted"
|
||||||
if akai_ponzu=$(ls "$rdhome"/Yuzu*.AppImage 1> /dev/null 2>&1) \
|
local ponzu_files=("$rdhome"/ponzu/Citra*.AppImage "$rdhome"/ponzu/citra*.AppImage "$rdhome"/ponzu/Yuzu*.AppImage "$rdhome"/ponzu/yuzu*.AppImage)
|
||||||
|| akai_ponzu=$(ls "$rdhome"/yuzu*.AppImage 1> /dev/null 2>&1); then
|
local data_dir
|
||||||
log i "Found akai ponzu! Elaborating it"
|
local appimage
|
||||||
local data_dir="/var/data/Yuzu"
|
local executable
|
||||||
local appimage="$akai_ponzu"
|
|
||||||
|
# Loop through all ponzu files
|
||||||
|
for ponzu_file in "${ponzu_files[@]}"; do
|
||||||
|
# Check if the current ponzu file exists
|
||||||
|
if [ -f "$ponzu_file" ]; then
|
||||||
|
if [[ "$ponzu_file" == *itra*]]; then
|
||||||
|
log i "Found akai ponzu! Elaborating it"
|
||||||
|
data_dir="/var/data/Citra"
|
||||||
|
local message="Akai ponzu is served, enjoy"
|
||||||
|
elif [[ "$ponzu_file" == *uzu* ]]; then
|
||||||
|
log i "Found kiroi ponzu! Elaborating it"
|
||||||
|
data_dir="/var/data/Yuzu"
|
||||||
|
local message="Kiroi ponzu is served, enjoy"
|
||||||
|
else
|
||||||
|
log e "AppImage not recognized, not a ponzu ingredient!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
appimage="$ponzu_file"
|
||||||
create_dir "$data_dir"
|
create_dir "$data_dir"
|
||||||
log d "Moving AppImage in \"$data_dir\""
|
log d "Moving AppImage in \"$data_dir\""
|
||||||
mv "$appimage" "$data_dir"
|
mv "$appimage" "$data_dir"
|
||||||
|
@ -705,12 +696,13 @@ ponzu() {
|
||||||
cp -r squashfs-root/* "$tmp_folder"
|
cp -r squashfs-root/* "$tmp_folder"
|
||||||
rm -rf *
|
rm -rf *
|
||||||
mv "$tmp_folder/"** .
|
mv "$tmp_folder/"** .
|
||||||
local executable=""
|
executable=""
|
||||||
log d "Making $executable executable"
|
log d "Making $executable executable"
|
||||||
chmod +x "$executable"
|
chmod +x "$executable"
|
||||||
cd -
|
cd -
|
||||||
log i "Akai ponzu is served, enjoy"
|
log i "$message"
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# TODO: this function is not yet used
|
# TODO: this function is not yet used
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 35d4fce1b9959b8568838659ea7e8c239139d3c8
|
Subproject commit ea1dae930a6f61388c2b5e05f95bb6ed0120926e
|
Loading…
Reference in a new issue