Last active
May 31, 2018 01:33
-
-
Save rockymadden/3467353 to your computer and use it in GitHub Desktop.
Scala bash script header. Nice because it will automatically load jars in the same directory into the classpath. I use it when making thin CLI wrappers around sibling projects APIs. Works on all OS X and Debian machines I have tried.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dir="`dirname \"$0\"`" | |
dir="`( cd \"$dir\" && pwd )`" | |
cp=`echo $dir/*.jar|sed 's/ /:/g'` | |
exec scala -classpath "$cp" -savecompiled "$0" "$@" | |
!# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment