better executable original path resolution
Showing
1 changed file
with
3 additions
and
3 deletions
1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
2 | 2 | ||
3 | CASPER_EXECUTABLE=${BASH_SOURCE[0]} | 3 | CASPER_EXECUTABLE=${BASH_SOURCE[0]} |
4 | 4 | ||
5 | if [ -h "$CASPER_EXECUTABLE" ]; then | 5 | while [ -h "$CASPER_EXECUTABLE" ]; do |
6 | CASPER_EXECUTABLE="$( readlink $CASPER_EXECUTABLE )" | 6 | CASPER_EXECUTABLE="$( readlink $CASPER_EXECUTABLE )" |
7 | fi | 7 | done |
8 | 8 | ||
9 | CASPERJS_HOME="$( cd -PL "$( dirname "$CASPER_EXECUTABLE" )" && cd .. && pwd )" | 9 | CASPERJS_HOME="$( cd -PL "$( dirname "$CASPER_EXECUTABLE" )" && cd .. && pwd )" |
10 | phantomjs $CASPERJS_HOME/casper.js --casper-path=$CASPERJS_HOME $* | 10 | phantomjs $CASPERJS_HOME/casper.js --casper-path=$CASPERJS_HOME $* | ... | ... |
-
Please register or sign in to post a comment