pegjs/bin/pegjs
David Majda 08635b658b Make bin/pegjs work when called via a symlink
Similar issue exists on Windows too (they have symlinks since Vista), but I
could not find how to dereference symlinks from batch files, so I did not fix
it. I guess this does not matter much given how little the symlinks are used in
the Windows world.

Closes #1.
2010-05-14 17:47:25 +02:00

11 lines
184 B
Bash
Executable file

#!/bin/sh
if [ -L "$0" ]; then
THIS_FILE=`readlink "$0"`
else
THIS_FILE=$0
fi
DIR=`dirname "$THIS_FILE"`
java -jar "$DIR/../vendor/rhino/js.jar" "$DIR/pegjs-main.js" "$DIR" "$@"