Skip to content

Instantly share code, notes, and snippets.

@eliasdorneles
Last active April 27, 2017 17:55
Show Gist options
  • Save eliasdorneles/e08d653607c854f30ffae16c6b3bd7b9 to your computer and use it in GitHub Desktop.
Save eliasdorneles/e08d653607c854f30ffae16c6b3bd7b9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script assumes you're using the directory layout described in the
# documentation at: https://voc.readthedocs.io/en/latest/tutorials/tutorial-0.html
set -e
set -x
abort() {
echo "$*"; exit 1;
}
usage() {
abort "Usage: $(basename $0) [-h|--help] PY_SCRIPT_FILE"
}
require() {
type $1 >/dev/null 2>/dev/null
}
while [ "${1#-}" != "$1" ]; do
case "$1" in
-h|--help) usage;;
*) usage;;
esac
shift
done
pyfile="$1"
basefile=$(basename $pyfile .py)
(cd ../voc && ant java)
voc -v $pyfile
java -cp ../voc/dist/python-java-support.jar:. python.${basefile}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment