Skip to content

Commit c73bf3f

Browse files
authored
run.sh: make BASEDIR usable earlier
1 parent 6136cd9 commit c73bf3f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

assets/nix/run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
# 1. Via CLI: Run ./run.sh <path to game> [doorstop arguments] [game arguments]
99
# 2. Via config: edit the options below and run ./run.sh without any arguments
1010

11-
# 0 is false, 1 is true
11+
# Use POSIX-compatible way to get the directory of the executable
12+
a="/$0"; a=${a%/*}; a=${a#/}; a=${a:-.}; BASEDIR=$(cd "$a" || exit; pwd -P)
1213

1314
# LINUX: name of Unity executable
1415
# MACOS: name of the .app directory
@@ -18,6 +19,8 @@ executable_name=""
1819

1920
# General Config Options
2021

22+
# 0 is false, 1 is true
23+
2124
# Enable Doorstop?
2225
enabled="1"
2326

@@ -82,9 +85,6 @@ if [ -z "${executable_name}" ] || [ ! -x "${executable_name}" ]; then
8285
exit 1
8386
fi
8487

85-
# Use POSIX-compatible way to get the directory of the executable
86-
a="/$0"; a=${a%/*}; a=${a#/}; a=${a:-.}; BASEDIR=$(cd "$a" || exit; pwd -P)
87-
8888
arch=""
8989
executable_path=""
9090
lib_extension=""

0 commit comments

Comments
 (0)