mirror of https://github.com/sbt/sbt.git
[2.x] fix: Fix sbt new argument parsing on Windows (#8509)
Only recombine split -- arguments after new/init command. Fixes #7507
This commit is contained in:
parent
d4570e3359
commit
28f7957307
|
|
@ -547,6 +547,21 @@ if not "%g:~0,5%" == "-XX:+" if not "%g:~0,5%" == "-XX:-" if "%g:~0,3%" == "-XX"
|
|||
)
|
||||
)
|
||||
|
||||
if defined sbt_new if "%g:~0,2%" == "--" (
|
||||
rem special handling for -- template arguments since '=' gets parsed away on Windows
|
||||
for /F "tokens=1 delims==" %%a in ("%g%") do (
|
||||
rem make sure it doesn't have the '=' already
|
||||
if "%g%" == "%%a" (
|
||||
if not "%~1" == "" (
|
||||
call :dlog [args_loop] -- argument %~0=%~1
|
||||
set "SBT_ARGS=!SBT_ARGS! %~0=%~1"
|
||||
shift
|
||||
goto args_loop
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
rem the %0 (instead of %~0) preserves original argument quoting
|
||||
set SBT_ARGS=!SBT_ARGS! %0
|
||||
|
||||
|
|
@ -782,6 +797,18 @@ if not "%p:~0,5%" == "-XX:+" if not "%p:~0,5%" == "-XX:-" if "%p:~0,3%" == "-XX"
|
|||
)
|
||||
)
|
||||
|
||||
if defined sbt_new if "%p:~0,2%" == "--" (
|
||||
rem special handling for -- template arguments since '=' gets parsed away on Windows
|
||||
for /F "tokens=1 delims==" %%a in ("%p%") do (
|
||||
rem make sure it doesn't have the '=' already
|
||||
if "%p%" == "%%a" if not "%~1" == "" (
|
||||
echo %0=%1
|
||||
shift
|
||||
goto echolist
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if "%p:~0,14%" == "-agentlib:jdwp" (
|
||||
rem special handling for --jvm-debug since '=' and ',' gets parsed away
|
||||
for /F "tokens=1 delims==" %%a in ("%p%") do (
|
||||
|
|
|
|||
Loading…
Reference in New Issue