[MNG-6223] support -f path/to/dir when detecting .mvn Project: http://git-wip-us.apache.org/repos/asf/maven/repo Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/2d440155 Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/2d440155 Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/2d440155
Branch: refs/heads/MNG-6196_slf4j Commit: 2d4401557c3c870409e8b1c65d2dcc9a68281cae Parents: be22380 Author: Hervé Boutemy <hbout...@apache.org> Authored: Sat May 6 18:15:42 2017 +0200 Committer: Hervé Boutemy <hbout...@apache.org> Committed: Tue May 9 21:07:41 2017 +0200 ---------------------------------------------------------------------- apache-maven/src/bin/mvn | 4 +++- apache-maven/src/bin/mvn.cmd | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/maven/blob/2d440155/apache-maven/src/bin/mvn ---------------------------------------------------------------------- diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn index 623b5f2..eedd344 100755 --- a/apache-maven/src/bin/mvn +++ b/apache-maven/src/bin/mvn @@ -141,7 +141,9 @@ find_file_argument_basedir() { found_file_switch=0 for arg in "$@"; do if [ ${found_file_switch} -eq 1 ]; then - if [ -f "${arg}" ]; then + if [ -d "${arg}" ]; then + basedir=`cd "${arg}" && pwd -P` + elif [ -f "${arg}" ]; then basedir=`dirname "${arg}"` basedir=`cd "${basedir}" && pwd -P` if [ ! -d "${basedir}" ]; then http://git-wip-us.apache.org/repos/asf/maven/blob/2d440155/apache-maven/src/bin/mvn.cmd ---------------------------------------------------------------------- diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd index 9d92279..bfcc1b5 100644 --- a/apache-maven/src/bin/mvn.cmd +++ b/apache-maven/src/bin/mvn.cmd @@ -120,7 +120,11 @@ if not exist "%FILE_ARG%" ( echo POM file %FILE_ARG% specified the -f/--file command-line argument does not exist >&2 goto error ) -call :get_directory_from_file "%FILE_ARG%" +if exist "%FILE_ARG%\*" ( + set "POM_DIR=%FILE_ARG%" +) else ( + call :get_directory_from_file "%FILE_ARG%" +) if not exist "%POM_DIR%" ( echo Directory %POM_DIR% extracted from the -f/--file command-line argument %FILE_ARG% does not exist >&2 goto error