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.
redux
David Majda 15 years ago
parent 6f2a188efc
commit 08635b658b

@ -1,4 +1,10 @@
#!/bin/sh
DIR=`dirname "$0"`
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" "$@"

Loading…
Cancel
Save