mirror of https://github.com/apache/maven.git
Fix while loop so that basedir is detected in current dir
There was a problem with the logic in the while loop that detects the base dir - it should first look in the current directory, otherwise you can't build in a directory with local settings because it will always climb up and find .mvn in a parent directory (e.g. user's home).
This commit is contained in:
parent
252caf7fa0
commit
10296a8036
|
@ -200,11 +200,11 @@ find_maven_basedir() {
|
||||||
local basedir=$(pwd)
|
local basedir=$(pwd)
|
||||||
local wdir=$(pwd)
|
local wdir=$(pwd)
|
||||||
while [ "$wdir" != '/' ] ; do
|
while [ "$wdir" != '/' ] ; do
|
||||||
wdir=$(cd "$wdir/.."; pwd)
|
|
||||||
if [ -d "$wdir"/.mvn ] ; then
|
if [ -d "$wdir"/.mvn ] ; then
|
||||||
basedir=$wdir
|
basedir=$wdir
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
wdir=$(cd "$wdir/.."; pwd)
|
||||||
done
|
done
|
||||||
echo "${basedir}"
|
echo "${basedir}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue