File tree Expand file tree Collapse file tree 7 files changed +84
-63
lines changed
Expand file tree Collapse file tree 7 files changed +84
-63
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,19 @@ if [[ "$_java" ]]; then
2121fi
2222
2323# Resolve script directory, handling symlinks
24- SCRIPT_PATH=" $0 "
25- while [ -L " $SCRIPT_PATH " ]; do
26- SCRIPT_PATH=$( readlink " $SCRIPT_PATH " )
27- # If relative symlink, resolve relative to original dir
28- if [[ " $SCRIPT_PATH " != /* ]]; then
29- SCRIPT_PATH=" $( cd " $( dirname " $0 " ) " > /dev/null 2>&1 && pwd ) /$SCRIPT_PATH "
30- fi
24+ PRG=" $0 "
25+ while [ -L " $PRG " ]; do
26+ ls=$( ls -ld " $PRG " )
27+ link=$( expr " $ls " : ' .*-> \(.*\)$' )
28+ if expr " $link " : ' /.*' > /dev/null; then
29+ PRG=" $link "
30+ else
31+ PRG=" $( dirname " $PRG " ) /$link "
32+ fi
3133done
32- SCRIPT_DIR=" $( cd " $( dirname " $SCRIPT_PATH " ) " > /dev/null 2>&1 && pwd ) "
33- base_dir=" $SCRIPT_DIR /.."
34+
35+ SCRIPT_DIR=" $( cd " $( dirname " $PRG " ) " > /dev/null 2>&1 && pwd) "
36+ base_dir=" $( cd " $SCRIPT_DIR /.." > /dev/null 2>&1 && pwd) "
3437
3538case " $( uname -s) " in
3639 * CYGWIN* ) base_dir=` cygpath -w " $base_dir " ` ;;
Original file line number Diff line number Diff line change @@ -21,16 +21,19 @@ if [[ "$_java" ]]; then
2121fi
2222
2323# Resolve script directory, handling symlinks
24- SCRIPT_PATH=" $0 "
25- while [ -L " $SCRIPT_PATH " ]; do
26- SCRIPT_PATH=$( readlink " $SCRIPT_PATH " )
27- # If relative symlink, resolve relative to original dir
28- if [[ " $SCRIPT_PATH " != /* ]]; then
29- SCRIPT_PATH=" $( cd " $( dirname " $0 " ) " > /dev/null 2>&1 && pwd ) /$SCRIPT_PATH "
30- fi
24+ PRG=" $0 "
25+ while [ -L " $PRG " ]; do
26+ ls=$( ls -ld " $PRG " )
27+ link=$( expr " $ls " : ' .*-> \(.*\)$' )
28+ if expr " $link " : ' /.*' > /dev/null; then
29+ PRG=" $link "
30+ else
31+ PRG=" $( dirname " $PRG " ) /$link "
32+ fi
3133done
32- SCRIPT_DIR=" $( cd " $( dirname " $SCRIPT_PATH " ) " > /dev/null 2>&1 && pwd ) "
33- base_dir=" $SCRIPT_DIR /.."
34+
35+ SCRIPT_DIR=" $( cd " $( dirname " $PRG " ) " > /dev/null 2>&1 && pwd) "
36+ base_dir=" $( cd " $SCRIPT_DIR /.." > /dev/null 2>&1 && pwd) "
3437
3538case " $( uname -s) " in
3639 * CYGWIN* ) base_dir=` cygpath -w " $base_dir " ` ;;
Original file line number Diff line number Diff line change @@ -21,16 +21,19 @@ if [[ "$_java" ]]; then
2121fi
2222
2323# Resolve script directory, handling symlinks
24- SCRIPT_PATH=" $0 "
25- while [ -L " $SCRIPT_PATH " ]; do
26- SCRIPT_PATH=$( readlink " $SCRIPT_PATH " )
27- # If relative symlink, resolve relative to original dir
28- if [[ " $SCRIPT_PATH " != /* ]]; then
29- SCRIPT_PATH=" $( cd " $( dirname " $0 " ) " > /dev/null 2>&1 && pwd ) /$SCRIPT_PATH "
30- fi
24+ PRG=" $0 "
25+ while [ -L " $PRG " ]; do
26+ ls=$( ls -ld " $PRG " )
27+ link=$( expr " $ls " : ' .*-> \(.*\)$' )
28+ if expr " $link " : ' /.*' > /dev/null; then
29+ PRG=" $link "
30+ else
31+ PRG=" $( dirname " $PRG " ) /$link "
32+ fi
3133done
32- SCRIPT_DIR=" $( cd " $( dirname " $SCRIPT_PATH " ) " > /dev/null 2>&1 && pwd ) "
33- base_dir=" $SCRIPT_DIR /.."
34+
35+ SCRIPT_DIR=" $( cd " $( dirname " $PRG " ) " > /dev/null 2>&1 && pwd) "
36+ base_dir=" $( cd " $SCRIPT_DIR /.." > /dev/null 2>&1 && pwd) "
3437
3538case " $( uname -s) " in
3639 * CYGWIN* ) base_dir=` cygpath -w " $base_dir " ` ;;
Original file line number Diff line number Diff line change @@ -21,16 +21,19 @@ if [[ "$_java" ]]; then
2121fi
2222
2323# Resolve script directory, handling symlinks
24- SCRIPT_PATH=" $0 "
25- while [ -L " $SCRIPT_PATH " ]; do
26- SCRIPT_PATH=$( readlink " $SCRIPT_PATH " )
27- # If relative symlink, resolve relative to original dir
28- if [[ " $SCRIPT_PATH " != /* ]]; then
29- SCRIPT_PATH=" $( cd " $( dirname " $0 " ) " > /dev/null 2>&1 && pwd ) /$SCRIPT_PATH "
30- fi
24+ PRG=" $0 "
25+ while [ -L " $PRG " ]; do
26+ ls=$( ls -ld " $PRG " )
27+ link=$( expr " $ls " : ' .*-> \(.*\)$' )
28+ if expr " $link " : ' /.*' > /dev/null; then
29+ PRG=" $link "
30+ else
31+ PRG=" $( dirname " $PRG " ) /$link "
32+ fi
3133done
32- SCRIPT_DIR=" $( cd " $( dirname " $SCRIPT_PATH " ) " > /dev/null 2>&1 && pwd ) "
33- base_dir=" $SCRIPT_DIR /.."
34+
35+ SCRIPT_DIR=" $( cd " $( dirname " $PRG " ) " > /dev/null 2>&1 && pwd) "
36+ base_dir=" $( cd " $SCRIPT_DIR /.." > /dev/null 2>&1 && pwd) "
3437
3538case " $( uname -s) " in
3639 * CYGWIN* ) base_dir=` cygpath -w " $base_dir " ` ;;
Original file line number Diff line number Diff line change @@ -21,16 +21,19 @@ if [[ "$_java" ]]; then
2121fi
2222
2323# Resolve script directory, handling symlinks
24- SCRIPT_PATH=" $0 "
25- while [ -L " $SCRIPT_PATH " ]; do
26- SCRIPT_PATH=$( readlink " $SCRIPT_PATH " )
27- # If relative symlink, resolve relative to original dir
28- if [[ " $SCRIPT_PATH " != /* ]]; then
29- SCRIPT_PATH=" $( cd " $( dirname " $0 " ) " > /dev/null 2>&1 && pwd ) /$SCRIPT_PATH "
30- fi
24+ PRG=" $0 "
25+ while [ -L " $PRG " ]; do
26+ ls=$( ls -ld " $PRG " )
27+ link=$( expr " $ls " : ' .*-> \(.*\)$' )
28+ if expr " $link " : ' /.*' > /dev/null; then
29+ PRG=" $link "
30+ else
31+ PRG=" $( dirname " $PRG " ) /$link "
32+ fi
3133done
32- SCRIPT_DIR=" $( cd " $( dirname " $SCRIPT_PATH " ) " > /dev/null 2>&1 && pwd ) "
33- base_dir=" $SCRIPT_DIR /.."
34+
35+ SCRIPT_DIR=" $( cd " $( dirname " $PRG " ) " > /dev/null 2>&1 && pwd) "
36+ base_dir=" $( cd " $SCRIPT_DIR /.." > /dev/null 2>&1 && pwd) "
3437
3538case " $( uname -s) " in
3639 * CYGWIN* ) base_dir=` cygpath -w " $base_dir " ` ;;
Original file line number Diff line number Diff line change @@ -21,16 +21,19 @@ if [[ "$_java" ]]; then
2121fi
2222
2323# Resolve script directory, handling symlinks
24- SCRIPT_PATH=" $0 "
25- while [ -L " $SCRIPT_PATH " ]; do
26- SCRIPT_PATH=$( readlink " $SCRIPT_PATH " )
27- # If relative symlink, resolve relative to original dir
28- if [[ " $SCRIPT_PATH " != /* ]]; then
29- SCRIPT_PATH=" $( cd " $( dirname " $0 " ) " > /dev/null 2>&1 && pwd ) /$SCRIPT_PATH "
30- fi
24+ PRG=" $0 "
25+ while [ -L " $PRG " ]; do
26+ ls=$( ls -ld " $PRG " )
27+ link=$( expr " $ls " : ' .*-> \(.*\)$' )
28+ if expr " $link " : ' /.*' > /dev/null; then
29+ PRG=" $link "
30+ else
31+ PRG=" $( dirname " $PRG " ) /$link "
32+ fi
3133done
32- SCRIPT_DIR=" $( cd " $( dirname " $SCRIPT_PATH " ) " > /dev/null 2>&1 && pwd ) "
33- base_dir=" $SCRIPT_DIR /.."
34+
35+ SCRIPT_DIR=" $( cd " $( dirname " $PRG " ) " > /dev/null 2>&1 && pwd) "
36+ base_dir=" $( cd " $SCRIPT_DIR /.." > /dev/null 2>&1 && pwd) "
3437
3538case " $( uname -s) " in
3639 * CYGWIN* ) base_dir=` cygpath -w " $base_dir " ` ;;
Original file line number Diff line number Diff line change @@ -21,16 +21,19 @@ if [[ "$_java" ]]; then
2121fi
2222
2323# Resolve script directory, handling symlinks
24- SCRIPT_PATH=" $0 "
25- while [ -L " $SCRIPT_PATH " ]; do
26- SCRIPT_PATH=$( readlink " $SCRIPT_PATH " )
27- # If relative symlink, resolve relative to original dir
28- if [[ " $SCRIPT_PATH " != /* ]]; then
29- SCRIPT_PATH=" $( cd " $( dirname " $0 " ) " > /dev/null 2>&1 && pwd ) /$SCRIPT_PATH "
30- fi
24+ PRG=" $0 "
25+ while [ -L " $PRG " ]; do
26+ ls=$( ls -ld " $PRG " )
27+ link=$( expr " $ls " : ' .*-> \(.*\)$' )
28+ if expr " $link " : ' /.*' > /dev/null; then
29+ PRG=" $link "
30+ else
31+ PRG=" $( dirname " $PRG " ) /$link "
32+ fi
3133done
32- SCRIPT_DIR=" $( cd " $( dirname " $SCRIPT_PATH " ) " > /dev/null 2>&1 && pwd ) "
33- base_dir=" $SCRIPT_DIR /.."
34+
35+ SCRIPT_DIR=" $( cd " $( dirname " $PRG " ) " > /dev/null 2>&1 && pwd) "
36+ base_dir=" $( cd " $SCRIPT_DIR /.." > /dev/null 2>&1 && pwd) "
3437
3538case " $( uname -s) " in
3639 * CYGWIN* ) base_dir=` cygpath -w " $base_dir " ` ;;
You can’t perform that action at this time.
0 commit comments