File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 7575
7676Feel welcome to submit ideas and suggestions.
7777
78- Related Proejcts
78+ Related Projects
7979================
8080
8181* [ coursier] ( https://github.com/alexarchambault/coursier ) - Pure Scala Artifact Fetching. Potential more powerful replacement for ` expandcp.kts `
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ if ! which expandcp.kts &> /dev/null; then
77 chmod u+x ${installDir} /expandcp.kts
88fi
99
10- dependencies=$( grep -F " //DEPS" $1 | head -n1 | cut -f2- -d' ' | tr ' ,;' )
10+ dependencies=$( grep -F " //DEPS" $1 | head -n1 | cut -f2- -d' ' | tr ' ,;' ' ' )
1111# dependencies=" org.docopt:docopt:0.6.0-SNAPSHOT log4j:log4j:1.2.14 "
1212
1313if [ -n " $dependencies " ]; then
@@ -28,7 +28,10 @@ if [ "${OSTYPE//[0-9.]/}" == "darwin" ]; then md5sum(){ md5 -r $1; }; fi
2828
2929scriptCheckSum=$( md5sum $scriptFile | cut -c1-6)
3030
31- jarDir=$( dirname ${scriptFile} ) # see https://github.com/holgerbrandl/kscript/issues/5
31+ # # we can use readlink here which is not functional on macos, thus:
32+ # http://stackoverflow.com/questions/3915040/bash-fish-command-to-print-absolute-path-to-a-file
33+ abspath () { echo " $( cd " $( dirname " $1 " ) " ; pwd) /$( basename " $1 " ) " ; }
34+ jarDir=$( dirname $( abspath ${scriptFile} ) ) # see https://github.com/holgerbrandl/kscript/issues/5
3235jarFile=${jarDir} /.$( basename ${scriptFile} .kts) .${scriptCheckSum} .jar
3336
3437
@@ -45,6 +48,12 @@ if [ ! -f "${jarFile}" ]; then
4548
4649 kotlinc -classpath " ${classpath} " -d ${jarFile} ${scriptFile}
4750
51+ if [ $? -eq 1 ]; then
52+ echo " ERROR: compilation of '$scriptFile ' failed" >&2
53+ exit 1;
54+ fi
55+
56+
4857 mainJava=$( mktemp -dt kscript.XXXXXX) /Main_${className} .java
4958
5059 echo '
You can’t perform that action at this time.
0 commit comments