Support directories with spaces in mvn

find_maven_basedir() doesn't handle a current working directory containing spaces; this patch fixes this behaviour.
This commit is contained in:
Stephen Kitt 2015-09-01 21:16:47 +02:00 committed by Hervé Boutemy
parent a2eb2fe3ee
commit f0cc5e8af9
1 changed files with 4 additions and 4 deletions

View File

@ -197,10 +197,10 @@ fi
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
local basedir=$(pwd)
local wdir=$(pwd)
local basedir="$(pwd)"
local wdir="$(pwd)"
while [ "$wdir" != '/' ] ; do
wdir=$(cd "$wdir/.."; pwd)
wdir="$(cd "$wdir/.."; pwd)"
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
@ -216,7 +216,7 @@ concat_lines() {
fi
}
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-$(find_maven_basedir)}"
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch project base directory path to Windows format before