@@ -88,24 +88,23 @@ arch=""
8888executable_path=" "
8989lib_extension=" "
9090
91+ abs_path () {
92+ # Resolve relative path to absolute from BASEDIR
93+ if [ " $1 " = " ${1#/ } " ]; then
94+ set -- " ${BASEDIR} /${1} "
95+ fi
96+ echo " $( cd " $( dirname " $1 " ) " && pwd) /$( basename " $1 " ) "
97+ }
98+
9199# Set executable path and the extension to use for the libdoorstop shared object
92100os_type=" $( uname -s) "
93101case ${os_type} in
94102 Linux* )
95- executable_path=" ${executable_name} "
96- # Handle relative paths
97- if [ " $executable_path " = " ${executable_path#/ } " ]; then
98- executable_path=" ${BASEDIR} /${executable_path} "
99- fi
103+ executable_path=" $( abs_path " $executable_name " ) "
100104 lib_extension=" so"
101105 ;;
102106 Darwin* )
103- real_executable_name=" ${executable_name} "
104-
105- # Handle relative directories
106- if [ " $real_executable_name " = " ${real_executable_name#/ } " ]; then
107- real_executable_name=" ${BASEDIR} /${real_executable_name} "
108- fi
107+ real_executable_name=" $( abs_path " $executable_name " ) "
109108
110109 # If we're not even an actual executable, check .app Info for actual executable
111110 case $real_executable_name in
@@ -131,10 +130,6 @@ case ${os_type} in
131130 ;;
132131esac
133132
134- abs_path () {
135- echo " $( cd " $( dirname " $1 " ) " && pwd) /$( basename " $1 " ) "
136- }
137-
138133_readlink () {
139134 # relative links with readlink (without -f) do not preserve the path info
140135 ab_path=" $( abs_path " $1 " ) "
@@ -255,6 +250,8 @@ while [ $i -lt $max ]; do
255250 i=$(( i+ 1 ))
256251done
257252
253+ target_assembly=" $( abs_path " $target_assembly " ) "
254+
258255# Move variables to environment
259256export DOORSTOP_ENABLED=" $enabled "
260257export DOORSTOP_TARGET_ASSEMBLY=" $target_assembly "
0 commit comments