ability to choose local .zip instead of downloading it

This commit is contained in:
2026-05-20 17:20:32 +02:00
parent 06c7891aac
commit 73505d3087
+45 -10
View File
@@ -1,14 +1,43 @@
#!/bin/bash #!/bin/bash
search_paths=("$HOME/.steam/steam/steamapps/common" "$HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common" "$HOME/.local/share/Steam/steamapps/common" "/mnt" "/") search_paths=("$HOME/.steam/steam/steamapps/common" "$HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common" "$HOME/.local/share/Steam/steamapps/common" "/mnt" "/")
repository_url="https://api.github.com/repos/LukeYui/EldenRingSeamlessCoopRelease/releases/latest"
eldenring_dir="" eldenring_dir=""
sc_download_url=""
local_path=""
#gets latest download url from github read -p "Do you want to use the official Github-Repository [d] to download the mod or use an already downloaded .zip? [l] [D/l]: " input
sc_download_url=$(curl -s "https://api.github.com/repos/LukeYui/EldenRingSeamlessCoopRelease/releases/latest" | jq -r '.assets[0].browser_download_url')
if [[ -z "$sc_download_url" || "$sc_download_url" == "null" ]]; then if [[ $input == "l" || $input == "L" || $input == "local" || $input == "Local" ]]; then
echo "Failed to retrieve download URL" echo "Searching Downloads folder..."
exit 1 local_path=$(timeout 5 find $HOME/Downloads -iname Seamless*.zip) || true
if [[ -f "$local_path" && "$local_path" =~ ^.*Seamless.*.zip$ ]]; then
echo "File found at $local_path"
else
echo "File not found in $HOME/Downloads"
read -p "Please specify the path to your local .zip archive: " input
if [[ -z "$input" || "$input" == "null" ]]; then
echo "Empty path provided"
exit 1
elif [[ -f "$input" ]]; then
local_path=$input
echo "File found at $local_path"
elif [[ ! -z "$input" ]]; then
local_path=$(timeout 5 find $input -iname Seamless*.zip)
if [[ -f "$local_path" ]]; then
echo "File found at $local_path"
else
echo "File not found at $input"
exit 1
fi
fi
fi
else
sc_download_url=$(curl -s "https://api.github.com/repos/LukeYui/EldenRingSeamlessCoopRelease/releases/latest" | jq -r '.assets[0].browser_download_url')
fi fi
echo "Searching for Elden Ring game folder" echo "Searching for Elden Ring game folder"
@@ -42,15 +71,21 @@ fi
input="" input=""
echo "Creating temp download folder" echo "Creating temp folder"
temp_dir=$(mktemp -d) temp_dir=$(mktemp -d)
cd "$temp_dir" cd "$temp_dir"
echo "Downloading Seamless Coop" if [[ -z $sc_download_url && -f $local_path ]]; then
echo "Download Url: $sc_download_url" echo "Copying .zip"
wget -q -O seamlesscoop.zip "$sc_download_url" cp "$local_path" ./seamlesscoop.zip
else
echo "Downloading Seamless Coop"
echo "Download Url: $sc_download_url"
wget -q -O seamlesscoop.zip "$sc_download_url"
fi
echo "Unzipping downloaded files"
echo "Unzipping files"
unzip -q seamlesscoop.zip unzip -q seamlesscoop.zip
rm seamlesscoop.zip rm seamlesscoop.zip