Skip to content

Commit 40eb8e1

Browse files
committed
Improve windows install script
1 parent 7189ef8 commit 40eb8e1

1 file changed

Lines changed: 11 additions & 16 deletions

File tree

install_windows.bat

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ set "VERSION=0.2.0-SNAPSHOT"
99
set "INSTALL_DIR=%CD%"
1010

1111
:: default for repository dir = standard maven repository
12-
for /F %%A in ('mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout') do (
13-
set REPO_DIR=%%A
14-
goto :donerepo
15-
)
16-
:donerepo
12+
set "REPO_DIR=%USERPROFILE%\.m2\repository"
1713

1814
:: parse arguments one by one
1915
:parse
2016
if "%~1"=="" goto :doneparsing
2117

22-
if /i "%~1"=="/h" call :usage
18+
if /i "%~1"=="/h" call :usage & goto :EOF
2319
if /i "%~1"=="/i" set "INSTALL_DIR=%~2" & shift & shift & goto :parse
2420
if /i "%~1"=="/r" set "REPO_DIR=%~2" & shift & shift & goto :parse
21+
22+
:: argument doesn't match any of the above
23+
echo Unknown option "%~1"
24+
call :usage & goto :EOF
2525
:doneparsing
2626

2727
echo.
@@ -91,26 +91,21 @@ goto :EOF
9191
echo.
9292
echo java^^
9393
echo -Xmx%MEM_LIMIT%g^^
94-
echo -cp %USERPROFILE%\.m2\repository\net\preibisch\imglib2-st\%VERSION%\imglib2-st-%VERSION%.jar;^^
94+
echo -cp %REPO_DIR%\net\preibisch\imglib2-st\%VERSION%\imglib2-st-%VERSION%.jar;^^
9595
type cp.txt
9696
echo ^^
9797
echo %2 %%*
9898
) > %1
9999
goto :EOF
100100

101101
:usage
102-
echo USAGE: install_windows.bat [options]
102+
echo USAGE: install_windows.bat [options]
103103
echo.
104104
echo. OPTIONS
105105
echo. /h Display this help message
106-
echo. /i <install_dir> Install commands into <install_dir>
106+
echo. /i [install_dir] Install commands into [install_dir]
107107
echo. (default: current directory)
108-
echo. /r <repository_dir> Download dependencies into <repository_dir>
109-
echo. (default: standard maven repository, most
110-
echo. likely \%USERPROFILE\%\.m2\repository)
111-
goto :EOF
108+
echo. /r [repository_dir] Download dependencies into [repository_dir]
109+
echo. (default: %%USERPROFILE%%\.m2\repository)
112110

113111
endlocal
114-
115-
116-

0 commit comments

Comments
 (0)