[MNG-6223] support -f path/to/dir when detecting .mvn

This commit is contained in:
Hervé Boutemy 2017-05-06 18:15:42 +02:00
parent be22380893
commit 2d4401557c
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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