fix: sbt init

**Problem**
`sbt init` no longer works because of --allow-empty check.

**Solution**
Skip allow empty check for sbt init.
This commit is contained in:
Eugene Yokota 2025-03-02 21:02:55 -05:00
parent 003e54936f
commit 7409de3c40
2 changed files with 6 additions and 1 deletions

View File

@ -476,6 +476,11 @@ if "%~0" == "new" (
set sbt_new=true set sbt_new=true
) )
) )
if "%~0" == "init" (
if not defined SBT_ARGS (
set sbt_new=true
)
)
if "%g:~0,2%" == "-D" ( if "%g:~0,2%" == "-D" (
rem special handling for -D since '=' gets parsed away rem special handling for -D since '=' gets parsed away

2
sbt
View File

@ -639,7 +639,7 @@ process_my_args () {
-allow-empty|--allow-empty|-sbt-create|--sbt-create) allow_empty=true && shift ;; -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 ;; *) addResidual "$1" && shift ;;
esac esac