Browse Source

Make automatic detection of ANT_HOME work if ant is a symlink to the

actual ant script using a relative path as well.

Submitted by:	Leon Breedt <ljb@neverborn.ORG>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270777 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 23 years ago
parent
commit
15d9753a46
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      src/script/ant

+ 8
- 0
src/script/ant View File

@@ -28,6 +28,10 @@ if [ -z "$ANT_HOME" ] ; then
## resolve links - $0 may be a link to ant's home
PRG=$0
progname=`basename $0`
saveddir=`pwd`

# need this for relative symlinks
cd `dirname $PRG`
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
@@ -41,6 +45,10 @@ if [ -z "$ANT_HOME" ] ; then
ANT_HOME=`dirname "$PRG"`/..

# make it fully qualified
ANT_HOME=`cd "$ANT_HOME" && pwd`

cd $saveddir
fi

# For Cygwin, ensure paths are in UNIX format before anything is touched


Loading…
Cancel
Save