From 40167af167a9005118c91365ad3ecc806a1a0751 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Thu, 21 Jan 2016 23:26:25 -0500 Subject: [PATCH] Handle SBT_OPTS Fixes sbt/sbt-launcher-package#99 formerly known as sbt/sbt#2194. get_mem_opts() is a bash function that generates memory related options. This change makes it return `""` the SBT_OPTS variable contains memory-related options already. --- src/universal/bin/sbt-launch-lib.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/universal/bin/sbt-launch-lib.bash b/src/universal/bin/sbt-launch-lib.bash index d57f0e951..1210fa9f3 100755 --- a/src/universal/bin/sbt-launch-lib.bash +++ b/src/universal/bin/sbt-launch-lib.bash @@ -76,7 +76,9 @@ get_mem_opts () { # if we detect any of these settings in ${JAVA_OPTS} we need to NOT output our settings. # The reason is the Xms/Xmx, if they don't line up, cause errors. if [[ "${JAVA_OPTS}" == *-Xmx* ]] || [[ "${JAVA_OPTS}" == *-Xms* ]] || [[ "${JAVA_OPTS}" == *-XX:MaxPermSize* ]] || [[ "${JAVA_OPTS}" == *-XX:MaxMetaspaceSize* ]] || [[ "${JAVA_OPTS}" == *-XX:ReservedCodeCacheSize* ]]; then - echo "" + echo "" + elif [[ "${SBT_OPTS}" == *-Xmx* ]] || [[ "${SBT_OPTS}" == *-Xms* ]] || [[ "${SBT_OPTS}" == *-XX:MaxPermSize* ]] || [[ "${SBT_OPTS}" == *-XX:MaxMetaspaceSize* ]] || [[ "${SBT_OPTS}" == *-XX:ReservedCodeCacheSize* ]]; then + echo "" else # a ham-fisted attempt to move some memory settings in concert # so they need not be messed around with individually.