Update sbt.bat --script-version to execute early and avoid java check/robocopy bootstrap - Fixes #5220

This commit is contained in:
Eric Peters 2019-11-17 08:32:28 -08:00
parent 98aac0a413
commit 63eabf3c8f
2 changed files with 8 additions and 8 deletions

View File

@ -161,7 +161,7 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
}
test("sbt --script-version should print sbtVersion") {
val out = sbtProcessWithOpts("--numeric-version", "", "").!!.trim
val out = sbtProcessWithOpts("--script-version", "", "").!!.trim
val expectedVersion = "^"+versionRegEx+"$"
assert(out.matches(expectedVersion))
()

View File

@ -459,8 +459,6 @@ goto args_loop
rem Confirm a user's intent if the current directory does not look like an sbt
rem top-level directory and the "new" command was not given.
rem TODO: if not -sbt-create
if not defined sbt_args_sbt_create if not defined sbt_args_print_version if not defined sbt_args_print_sbt_version if not defined sbt_args_print_sbt_script_version if not exist build.sbt (
if not exist project\ (
if not defined sbt_new (
@ -486,6 +484,13 @@ if not defined sbt_args_sbt_create if not defined sbt_args_print_version if not
call :process
rem avoid bootstrapping/java version check for script version
if !sbt_args_print_sbt_script_version! equ 1 (
echo !init_sbt_version!
goto :eof
)
call :checkjava
call :copyrt
@ -569,11 +574,6 @@ set sbt_jar=!sbt_jar:"=!
rem TODO: _SBT_OPTS needs to be processed as args and diffed against SBT_ARGS
if !sbt_args_print_sbt_script_version! equ 1 (
echo !init_sbt_version!
goto :eof
)
if !sbt_args_print_sbt_version! equ 1 (
call :set_sbt_version
echo !sbt_version!