[MNG-6837] Simplify detection of the MAVEN_HOME and make it fully qualified on Windows

The removed 'stripMHome' recursive function is not needed anymore

This closes #307
This commit is contained in:
Rostislav Krasny 2020-01-01 20:30:15 +02:00 committed by Michael Osipov
parent d4ad077ef5
commit 3a465e1477
1 changed files with 3 additions and 7 deletions

View File

@ -60,15 +60,11 @@ echo NB: JAVA_HOME should point to a JDK not a JRE >&2
goto error goto error
:chkMHome :chkMHome
set "MAVEN_HOME=%~dp0.." set "MAVEN_HOME=%~dp0"
if not "%MAVEN_HOME%"=="" goto stripMHome set "MAVEN_HOME=%MAVEN_HOME:~0,-5%"
if not "%MAVEN_HOME%"=="" goto checkMCmd
goto error goto error
:stripMHome
if not "_%MAVEN_HOME:~-1%"=="_\" goto checkMCmd
set "MAVEN_HOME=%MAVEN_HOME:~0,-1%"
goto stripMHome
:checkMCmd :checkMCmd
if exist "%MAVEN_HOME%\bin\mvn.cmd" goto init if exist "%MAVEN_HOME%\bin\mvn.cmd" goto init
goto error goto error