File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ while [[ $# -gt 0 ]]; do
78
78
shift
79
79
;;
80
80
-save|-savecompiled)
81
- save_compiled=1
81
+ save_compiled=true
82
82
addDotcOptions " ${1} "
83
83
shift
84
84
;;
@@ -93,10 +93,11 @@ while [[ $# -gt 0 ]]; do
93
93
* )
94
94
if [ $execute_script == false ]; then
95
95
# is a script if extension .scala or .sc or if has scala hash bang
96
- if [[ " $1 " == * .scala || " $1 " == * .sc || -f " $1 " && ` head -n 1 -- " $1 " | grep ' #!.*scala' ` ]]; then
96
+ if [[ -e " $1 " && ( " $1 " == * .scala || " $1 " == * .sc || -f " $1 " && ` head -n 1 -- " $1 " | grep ' #!.*scala' ` ) ]]; then
97
97
execute_script=true
98
98
[ -n " $SCALA_OPTS " ] && java_options+=($SCALA_OPTS )
99
99
target_script=" $1 "
100
+ if [ ! -f $target_script
100
101
else
101
102
residual_args+= (" $1 " )
102
103
fi
@@ -113,9 +114,9 @@ if [ $execute_script == true ]; then
113
114
if [ " $CLASS_PATH " ]; then
114
115
cp_arg=" -classpath \" $CLASS_PATH \" "
115
116
fi
117
+ setScriptName=" -Dscript.path=$target_script "
116
118
target_jar=" ${target_script% .* } .jar"
117
119
jar_found=false
118
- setScriptName=" -Dscript.path=$target_script "
119
120
[[ $save_compiled == true && -f " $target_jar " ]] && jar_found=true
120
121
if [[ $jar_found == true && " $target_jar " -nt " $target_script " ]]; then
121
122
java $setScriptName -jar " $target_jar " " ${script_args[@]} "
You can’t perform that action at this time.
0 commit comments