Skip to content

Fix for java command in bin/scala #11428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions dist/bin/scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ addJvmOptions () {
jvm_options+=("'$1'")
}

addDotcOptions () {
addScalacOptions () {
java_options+=("'$1'")
}

Expand Down Expand Up @@ -76,16 +76,16 @@ while [[ $# -gt 0 ]]; do
shift
;;
@*|-color:*)
addDotcOptions "${1}"
addScalacOptions "${1}"
shift
;;
-save|-savecompiled)
save_compiled=true
dotc_script_options+=("$1")
scala_script_options+=("$1")
shift
;;
-compile-only)
dotc_script_options+=("$1")
scala_script_options+=("$1")
shift
;;
-d)
Expand All @@ -94,7 +94,7 @@ while [[ $# -gt 0 ]]; do
;;
-J*)
addJvmOptions "${1:2}"
addDotcOptions "${1}"
addScalacOptions "${1}"
shift ;;
*)
if [ $execute_script == false ]; then
Expand All @@ -119,11 +119,11 @@ if [ $execute_script == true ]; then
if [ "$CLASS_PATH" ]; then
cp_arg="-classpath \"$CLASS_PATH\""
fi
java_options+=(${dotc_script_options})
java_options+=(${scala_script_options})
setScriptName="-Dscript.path=$target_script"
target_jar="${target_script%.*}.jar"
if [[ $save_compiled == true && "$target_jar" -nt "$target_script" ]]; then
java $setScriptName -jar "$target_jar" "${script_args[@]}"
eval exec "\"$JAVACMD\"" $setScriptName -jar "$target_jar" "${script_args[@]}"
else
[[ $save_compiled == true ]] && rm -f $target_jar
residual_args+=($setScriptName)
Expand Down