From 135102022763eaa62fa1d0125adab7ff207ef2f4 Mon Sep 17 00:00:00 2001 From: Joseph Walton Date: Mon, 30 Jan 2017 11:13:16 +0100 Subject: [PATCH] [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. --- apache-maven/src/bin/mvn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn index 4a7f610b79..172f43bc67 100755 --- a/apache-maven/src/bin/mvn +++ b/apache-maven/src/bin/mvn @@ -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