From 7409de3c405d6a7da76d440137f632438794cbf8 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 2 Mar 2025 21:02:55 -0500 Subject: [PATCH] fix: sbt init **Problem** `sbt init` no longer works because of --allow-empty check. **Solution** Skip allow empty check for sbt init. --- launcher-package/src/universal/bin/sbt.bat | 5 +++++ sbt | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/launcher-package/src/universal/bin/sbt.bat b/launcher-package/src/universal/bin/sbt.bat index 2bd4dd49e..3de1fbd88 100755 --- a/launcher-package/src/universal/bin/sbt.bat +++ b/launcher-package/src/universal/bin/sbt.bat @@ -476,6 +476,11 @@ if "%~0" == "new" ( set sbt_new=true ) ) +if "%~0" == "init" ( + if not defined SBT_ARGS ( + set sbt_new=true + ) +) if "%g:~0,2%" == "-D" ( rem special handling for -D since '=' gets parsed away diff --git a/sbt b/sbt index 9a7c36aa5..e414ad7bb 100755 --- a/sbt +++ b/sbt @@ -639,7 +639,7 @@ process_my_args () { -allow-empty|--allow-empty|-sbt-create|--sbt-create) allow_empty=true && shift ;; - new) sbt_new=true && addResidual "$1" && shift ;; + new|init) sbt_new=true && addResidual "$1" && shift ;; *) addResidual "$1" && shift ;; esac