Skip to content

Commit 1492745

Browse files
Merge pull request #11425 from philwalk/fix-11424
fix for #11424
2 parents 53a2dc5 + d166b56 commit 1492745

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

dist/bin/scala

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ truncated_params="${*#-}"
5353
# options_indicator != 0 if at least one parameter is not an option
5454
options_indicator=$(( ${#all_params} - ${#truncated_params} - $# ))
5555

56-
[ -n "$SCALA_OPTS" ] && set -- "$@" $SCALA_OPTS
56+
[ -n "$SCALA_OPTS" ] && set -- $SCALA_OPTS "$@"
5757

5858
while [[ $# -gt 0 ]]; do
5959
case "$1" in
@@ -75,13 +75,17 @@ while [[ $# -gt 0 ]]; do
7575
with_compiler=true
7676
shift
7777
;;
78-
@*|-color:*|-compile-only)
78+
@*|-color:*)
7979
addDotcOptions "${1}"
8080
shift
8181
;;
8282
-save|-savecompiled)
8383
save_compiled=true
84-
addDotcOptions "${1}"
84+
dotc_script_options+=("$1")
85+
shift
86+
;;
87+
-compile-only)
88+
dotc_script_options+=("$1")
8589
shift
8690
;;
8791
-d)
@@ -115,6 +119,7 @@ if [ $execute_script == true ]; then
115119
if [ "$CLASS_PATH" ]; then
116120
cp_arg="-classpath \"$CLASS_PATH\""
117121
fi
122+
java_options+=(${dotc_script_options})
118123
setScriptName="-Dscript.path=$target_script"
119124
target_jar="${target_script%.*}.jar"
120125
if [[ $save_compiled == true && "$target_jar" -nt "$target_script" ]]; then

0 commit comments

Comments
 (0)