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- # 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)
13-
1411# LINUX: name of Unity executable
1512# MACOS: name of the .app directory
1613executable_name=" "
@@ -107,6 +104,9 @@ if [ -x "$1" ] ; then
107104 shift
108105fi
109106
107+ # Use POSIX-compatible way to get the directory of the executable
108+ a=" /$0 " ; a=${a%/* } ; a=${a#/ } ; a=${a:- .} ; BASEDIR=$( cd " $a " || exit ; pwd -P)
109+
110110arch=" "
111111executable_path=" "
112112lib_extension=" "
@@ -169,8 +169,7 @@ _readlink() {
169169 echo " $link "
170170}
171171
172-
173- resolve_executable_path () {
172+ resolve_abs_path () {
174173 e_path=" $( abs_path " $1 " ) "
175174
176175 while [ -L " ${e_path} " ]; do
@@ -180,7 +179,7 @@ resolve_executable_path () {
180179}
181180
182181# Get absolute path of executable
183- executable_path=$( resolve_executable_path " ${executable_path} " )
182+ executable_path=$( resolve_abs_path " ${executable_path} " )
184183
185184# Figure out the arch of the executable with file
186185file_out=" $( LD_PRELOAD=" " file -b " ${executable_path} " ) "
@@ -284,9 +283,15 @@ while [ $i -lt $max ]; do
284283 i=$(( i+ 1 ))
285284done
286285
286+ # Get absolute path of target assembly
287+ if [ " $target_assembly " = " ${target_assembly#/ } " ]; then
288+ target_assembly_path=" ${BASEDIR} /${target_assembly} "
289+ fi
290+ target_assembly_path=$( resolve_abs_path " ${target_assembly_path} " )
291+
287292# Move variables to environment
288293export DOORSTOP_ENABLED=" $enabled "
289- export DOORSTOP_TARGET_ASSEMBLY=" $target_assembly "
294+ export DOORSTOP_TARGET_ASSEMBLY=" $target_assembly_path "
290295export DOORSTOP_BOOT_CONFIG_OVERRIDE=" $boot_config_override "
291296export DOORSTOP_IGNORE_DISABLED_ENV=" $ignore_disable_switch "
292297export DOORSTOP_MONO_DLL_SEARCH_PATH_OVERRIDE=" $dll_search_path_override "
0 commit comments