From ea93158ae3e76e1abb6dd383e4d88fccd6bc9410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B2=A9=E6=9D=BE=20=E7=AB=9C=E4=B9=9F?= Date: Tue, 19 Jun 2018 01:13:31 +0900 Subject: [PATCH] Handle SBT_OPTS in bash --- src/universal/bin/sbt-launch-lib.bash | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/universal/bin/sbt-launch-lib.bash b/src/universal/bin/sbt-launch-lib.bash index e7155a148..a69bff1d8 100755 --- a/src/universal/bin/sbt-launch-lib.bash +++ b/src/universal/bin/sbt-launch-lib.bash @@ -253,6 +253,24 @@ checkJava() { fi } +convertSbtOpts () { + while [[ $# -gt 0 ]]; do + case "$1" in + -no-colors) converted_opts="${converted_opts} -Dsbt.log.noformat=true" && shift ;; + -no-share) converted_opts="${converted_opts} $noshare_opts" && shift ;; + -no-global) converted_opts="${converted_opts} -Dsbt.global.base=$(pwd)/project/.sbtboot" && shift ;; + -sbt-boot) require_arg path "$1" "$2" && converted_opts="${converted_opts} -Dsbt.boot.directory=$2" && shift 2 ;; + -sbt-dir) require_arg path "$1" "$2" && converted_opts="${converted_opts} -Dsbt.global.base=$2" && shift 2 ;; + -debug-inc) converted_opts="${converted_opts} -Dxsbt.inc.debug=true" && shift ;; + -batch) exec =" 9)" if [[ "$at_least_9" == "1" ]]; then @@ -294,6 +312,14 @@ run() { # TODO - java check should be configurable... checkJava "6" + # handle SBT_OPTS options + if [ -n "$SBT_OPTS" ]; then + converted_opts="" + arrayed_sbt_opts=($SBT_OPTS) + convertSbtOpts ${arrayed_sbt_opts[@]} + SBT_OPTS=$converted_opts + fi + # Java 9 support copyRt