From d166b568e2c5cdf1522df21a519a8a666692487c Mon Sep 17 00:00:00 2001 From: Phil Date: Mon, 15 Feb 2021 13:26:01 -0700 Subject: [PATCH] fix for #11424 --- dist/bin/scala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dist/bin/scala b/dist/bin/scala index 79923347ecb1..aef601e7ec28 100755 --- a/dist/bin/scala +++ b/dist/bin/scala @@ -53,7 +53,7 @@ truncated_params="${*#-}" # options_indicator != 0 if at least one parameter is not an option options_indicator=$(( ${#all_params} - ${#truncated_params} - $# )) -[ -n "$SCALA_OPTS" ] && set -- "$@" $SCALA_OPTS +[ -n "$SCALA_OPTS" ] && set -- $SCALA_OPTS "$@" while [[ $# -gt 0 ]]; do case "$1" in @@ -75,13 +75,17 @@ while [[ $# -gt 0 ]]; do with_compiler=true shift ;; - @*|-color:*|-compile-only) + @*|-color:*) addDotcOptions "${1}" shift ;; -save|-savecompiled) save_compiled=true - addDotcOptions "${1}" + dotc_script_options+=("$1") + shift + ;; + -compile-only) + dotc_script_options+=("$1") shift ;; -d) @@ -115,6 +119,7 @@ if [ $execute_script == true ]; then if [ "$CLASS_PATH" ]; then cp_arg="-classpath \"$CLASS_PATH\"" fi + java_options+=(${dotc_script_options}) setScriptName="-Dscript.path=$target_script" target_jar="${target_script%.*}.jar" if [[ $save_compiled == true && "$target_jar" -nt "$target_script" ]]; then