[MNG-8165] Align mvn.sh script with mvn.cmd (#1648)

As one does check for .mvn directory in FS root while other does not, stops one level before.

---

https://issues.apache.org/jira/browse/MNG-8165
This commit is contained in:
Tamas Cservenak 2024-08-13 09:11:25 +02:00 committed by GitHub
parent 2a709dc038
commit cf2934b6ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -34,11 +34,15 @@ find_maven_basedir() {
(
basedir=`find_file_argument_basedir "$@"`
wdir="$basedir"
while [ "$wdir" != '/' ] ; do
while :
do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
if [ "$wdir" == '/' ] ; then
break
fi
wdir=`cd "$wdir/.."; pwd`
done
echo "$basedir"