added common steam paths to improve find time and added timeout
This commit is contained in:
+19
-4
@@ -1,6 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
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" "/")
|
||||||
|
eldenring_dir=""
|
||||||
|
|
||||||
#gets latest download url from github
|
#gets latest download url from github
|
||||||
sc_download_url=$(curl -s "https://api.github.com/repos/LukeYui/EldenRingSeamlessCoopRelease/releases/latest" | jq -r '.assets[0].browser_download_url')
|
sc_download_url=$(curl -s "https://api.github.com/repos/LukeYui/EldenRingSeamlessCoopRelease/releases/latest" | jq -r '.assets[0].browser_download_url')
|
||||||
|
|
||||||
@@ -9,11 +12,23 @@ if [[ -z "$sc_download_url" || "$sc_download_url" == "null" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#find elden ring install path
|
echo "Searching for Elden Ring game folder"
|
||||||
eldenring_dir=$(find / -path '*/Game/*' -iname eldenring.exe -printf '%h\n' -quit 2>/dev/null)
|
|
||||||
|
|
||||||
read -p "Is this your Elden Ring Game folder? $eldenring_dir [Y/n]: " input
|
for i in "${search_paths[@]}"; do
|
||||||
if [[ $input == "n" || $input == "N" || $input == "No" || $input == "no" ]]; then
|
echo "Searching at $i"
|
||||||
|
eldenring_dir=$(timeout 5 find "$i" -path '*/Game/*' -iname eldenring.exe -printf '%h\n' -quit 2>/dev/null || true)
|
||||||
|
|
||||||
|
if [ -n "$eldenring_dir" ]; then
|
||||||
|
read -p "Is this your Elden Ring Game folder? $eldenring_dir [y/N]: " input
|
||||||
|
|
||||||
|
if [[ $input == "y" || $input == "Y" || $input == "yes" || $input == "Yes" ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
eldenring_dir=""
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -z "$eldenring_dir" ]]; then
|
||||||
input=""
|
input=""
|
||||||
read -p "Please provide your Elden Ring Directory Path: " input
|
read -p "Please provide your Elden Ring Directory Path: " input
|
||||||
if test -f "$input/eldenring.exe"; then
|
if test -f "$input/eldenring.exe"; then
|
||||||
|
|||||||
Reference in New Issue
Block a user