mirror of https://github.com/sbt/sbt.git
fix: Read build.properties directly in --version handler to avoid hangs (#8717)
Instead of relying on the early build_props_sbt_version read, read build.properties directly in the --version handler using a local variable. This isolates file I/O to only when --version is called and avoids potential interference with normal script execution that could cause Windows test hangs.
This commit is contained in:
parent
8251ac544a
commit
95a3fc3288
|
|
@ -619,11 +619,17 @@ if !sbt_args_print_sbt_script_version! equ 1 (
|
|||
|
||||
rem Handle --version before native client so it works on sbt 2.x project dirs (#8717)
|
||||
if !sbt_args_print_version! equ 1 (
|
||||
if !is_this_dir_sbt! equ 1 (
|
||||
if not "!build_props_sbt_version!" == "" (
|
||||
echo sbt version in this project: !build_props_sbt_version!
|
||||
set "local_build_props_version="
|
||||
if exist "project\build.properties" (
|
||||
for /F "eol=# delims== tokens=1*" %%a in (project\build.properties) do (
|
||||
if "%%a" == "sbt.version" if not "%%b" == "" (
|
||||
set "local_build_props_version=%%b"
|
||||
)
|
||||
)
|
||||
)
|
||||
if not "!local_build_props_version!" == "" (
|
||||
echo sbt version in this project: !local_build_props_version!
|
||||
)
|
||||
echo sbt runner version: !init_sbt_version!
|
||||
echo.
|
||||
echo [info] sbt runner (sbt-the-batch-script) is a runner to run any declared version of sbt.
|
||||
|
|
|
|||
Loading…
Reference in New Issue