mirror of
https://github.com/sbt/sbt.git
synced 2026-10-07 18:43:31 +02:00
[2.x] fix: sbt.bat fails to start client/server mode on Windows (#9520)
sbt.bat fails to start in client/server mode on Windows, falling back to running the full JVM in the foreground. sbtn uses CreateProcess to spawn the server process. The original %%20 path encoding doesn't work in batch delayed expansion context, and the default install path C:\Program Files (x86) contains spaces that CreateProcess splits at.
This commit is contained in:
@@ -51,7 +51,7 @@ set sbt_args_allow_empty=
|
||||
set sbt_args_sbt_dir=
|
||||
set sbt_args_sbt_version=
|
||||
set sbt_args_mem=
|
||||
set sbt_args_client=
|
||||
set sbt_args_client=-1
|
||||
set sbt_args_jvm_client=
|
||||
set sbt_args_no_server=
|
||||
set sbt_args_experimental_execution_log=
|
||||
@@ -201,6 +201,14 @@ if defined _client_arg (
|
||||
goto args_loop
|
||||
)
|
||||
|
||||
if "%~0" == "--server" set _server_arg=true
|
||||
|
||||
if defined _server_arg (
|
||||
set _server_arg=
|
||||
set sbt_args_client=0
|
||||
goto args_loop
|
||||
)
|
||||
|
||||
if "%~0" == "--jvm-client" set _jvm_client_arg=true
|
||||
|
||||
if defined _jvm_client_arg (
|
||||
@@ -800,7 +808,7 @@ if defined sbt_args_verbose (
|
||||
set "SBT_ARGS=-v !SBT_ARGS!"
|
||||
)
|
||||
|
||||
set "SBT_SCRIPT=!SBT_BIN_DIR: =%%20!sbt.bat"
|
||||
for %%I in ("!SBT_BIN_DIR!sbt.bat") do set "SBT_SCRIPT=%%~sI"
|
||||
set "SBT_ARGS=--sbt-script=!SBT_SCRIPT! %SBT_ARGS%"
|
||||
|
||||
rem Microsoft Visual C++ 2010 SP1 Redistributable Package (x64) is required
|
||||
|
||||
Reference in New Issue
Block a user