[MNG-5852] mvn shell script invokes /bin/sh but requires Bash functions

'local' is not POSIX, but supported by most shells. However, it's not
supported by Solaris's /bin/sh, so use a subshell instead.

This closes #50.
This commit is contained in:
Joseph Walton 2017-01-30 11:13:16 +01:00 committed by Michael Osipov
parent 1d9708a954
commit 1351020227
1 changed files with 2 additions and 2 deletions

View File

@ -190,8 +190,7 @@ 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
local wdir
(
basedir="`pwd`"
wdir="`pwd`"
while [ "$wdir" != '/' ] ; do
@ -202,6 +201,7 @@ find_maven_basedir() {
wdir="`cd "$wdir/.."; pwd`"
done
echo "${basedir}"
)
}
# concatenates all lines of a file