Skip to content

Commit 6abda2f

Browse files
committed
run.sh: Change Steam executable detection to a simpler check for a file located in the working directory
1 parent 4613daa commit 6abda2f

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

assets/nix/run.sh

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,15 @@ corlib_dir=""
6262
# Everything past this point is the actual script
6363
set -e
6464

65-
# Special case: program is launched via Steam
66-
# In that case rerun the script via their bootstrapper to ensure Steam overlay works
67-
steam_arg_helper() {
68-
if [ "$executable_name" != "" ] && [ "$1" != "${1%"$executable_name"}" ]; then
69-
return 0
70-
elif [ "$executable_name" = "" ] && [ "$1" != "${1%.x86_64}" ]; then
71-
return 0
72-
elif [ "$executable_name" = "" ] && [ "$1" != "${1%.x86}" ]; then
73-
return 0
74-
else
75-
return 1
76-
fi
77-
}
65+
# Special case: program is launched via Steam on Linux
66+
# In that case rerun the script via their bootstrapper to delay adding Doorstop to LD_PRELOAD
67+
# This is required until https://github.com/NeighTools/UnityDoorstop/issues/88 is resolved
7868
for a in "$@"; do
7969
if [ "$a" = "SteamLaunch" ]; then
8070
rotated=0; max=$#
8171
while [ $rotated -lt $max ]; do
82-
if steam_arg_helper "$1"; then
72+
# Test if argument is prefixed with the value of $PWD
73+
if [ "$1" != "${1#"${PWD%/}/"}" ]; then
8374
to_rotate=$(($# - rotated))
8475
set -- "$@" "$0"
8576
while [ $((to_rotate-=1)) -ge 0 ]; do
@@ -93,7 +84,7 @@ for a in "$@"; do
9384
rotated=$((rotated+1))
9485
fi
9586
done
96-
echo "Please set executable_name to a valid name in a text editor" 1>&2
87+
echo "Could not determine game executable launched by Steam" 1>&2
9788
exit 1
9889
fi
9990
done

0 commit comments

Comments
 (0)