1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 01:57:09 +03:00

java: Add 'run' script which quotes arguments correctly

This commit is contained in:
Dov Murik 2016-05-14 23:42:58 -04:00
parent 09dce03504
commit e09f1b102a
2 changed files with 10 additions and 1 deletions

View File

@ -236,7 +236,7 @@ haskell_RUNSTEP = ../$(2) $(3)
haxe_RUNSTEP = python3 ../$(2) $(3)
haxe_RUNSTEP = $(haxe_RUNSTEP_$(HAXE_MODE))
io_RUNSTEP = env STEP=$($(1)) ./run $(3)
java_RUNSTEP = mvn -quiet exec:java -Dexec.mainClass="mal.$($(1))" $(if $(3), -Dexec.args="$(3)",)
java_RUNSTEP = env STEP=$($(1)) ./run $(3)
julia_RUNSTEP = ../$(2) $(3)
js_RUNSTEP = node ../$(2) $(3)
kotlin_RUNSTEP = java -jar ../$(2) $(3)

9
java/run Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
args=""
if [ "$#" -gt 0 ]; then
args="-Dexec.args='$1'"
for a in "${@:2}"; do
args="$args '$a'"
done
fi
exec mvn -quiet exec:java -Dexec.mainClass="mal.${STEP:-stepA_mal}" "$args"