mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Accept SPRING_HOME if already set
This commit is contained in:
parent
2de91a8138
commit
34500632d4
@ -54,22 +54,24 @@ if [ ! -f "${JAVA_HOME}/bin/java" ]; then
|
||||
fi
|
||||
|
||||
# Attempt to find SPRING_HOME if not already set
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/../" >&-
|
||||
SPRING_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
if [ -z "${SPRING_HOME}" ]; then
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/../" >&-
|
||||
SPRING_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
fi
|
||||
|
||||
if [ ! -d "${SPRING_HOME}" ]; then
|
||||
echo "Not a directory: SPRING_HOME=${SPRING_HOME}"
|
||||
|
Loading…
Reference in New Issue
Block a user