[2.x] fix: Skip native client for sbt new/init commands (#8512)

Fixes #7497
This commit is contained in:
MkDev11 2026-01-13 05:18:05 -05:00 committed by GitHub
parent 570ca30f69
commit d4570e3359
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -926,6 +926,11 @@ for /f "delims=.-_ tokens=1-2" %%v in ("!JAVA_VERSION!") do (
rem parse the first two segments of sbt.version and set run_native_client to
rem 1 if the user has also indicated they want to use native client.
rem sbt new/init should not use native client as it needs to run outside a project
if defined sbt_new (
set run_native_client=
exit /B 0
)
set sbtV=!build_props_sbt_version!
set sbtBinaryV_1=
set sbtBinaryV_2=

5
sbt
View File

@ -805,6 +805,11 @@ detectNativeClient() {
# Run native client if build.properties points to 1.4+ and has SBT_NATIVE_CLIENT
isRunNativeClient() {
# sbt new/init should not use native client as it needs to run outside a project
if [[ "$sbt_new" == "true" ]]; then
echo "false"
return
fi
sbtV="$build_props_sbt_version"
[[ "$sbtV" == "" ]] && sbtV="$init_sbt_version"
[[ "$sbtV" == "" ]] && sbtV="0.0.0"