fix: Restore --version check inside native client block to fix hang (#8717)

Revert to checking --version inside the if !run_native_client! block
to match the working version's execution flow. This should fix the
Windows hang while still preventing hangs when --version is used in
sbt 2.x project directories.
This commit is contained in:
Eruis2579 2026-02-11 01:38:12 +01:00
parent 9179f4cf80
commit 9c48e31511
1 changed files with 4 additions and 14 deletions

View File

@ -617,21 +617,11 @@ if !sbt_args_print_sbt_script_version! equ 1 (
goto :eof
)
rem Handle --version before native client to avoid hangs in sbt 2.x project dirs (#8717)
if "!sbt_args_print_version!" == "1" (
if "!is_this_dir_sbt!" == "1" (
if not "!build_props_sbt_version!" == "" (
echo sbt version in this project: !build_props_sbt_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.
echo [info] Actual version of the sbt is declared using project\build.properties for each build.
goto :eof
)
if !run_native_client! equ 1 (
rem Skip native client if --version is set to avoid hangs in sbt 2.x project dirs (#8717)
if "!sbt_args_print_version!" == "1" (
goto :skip_native_for_version
)
goto :runnative !SBT_ARGS!
goto :eof
)