fixes #31 - replaced bash executable script by a Python one
Showing
3 changed files
with
29 additions
and
9 deletions
1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env python |
2 | 2 | ||
3 | CASPER_EXECUTABLE=${BASH_SOURCE[0]} | 3 | import os |
4 | import subprocess | ||
5 | import sys | ||
4 | 6 | ||
5 | while [ -h "$CASPER_EXECUTABLE" ]; do | ||
6 | CASPER_EXECUTABLE="$( readlink $CASPER_EXECUTABLE )" | ||
7 | done | ||
8 | 7 | ||
9 | CASPERJS_HOME="$( cd -PL "$( dirname "$CASPER_EXECUTABLE" )" && cd .. && pwd )" | 8 | def resolve(path): |
10 | phantomjs $CASPERJS_HOME/casper.js --casper-path=$CASPERJS_HOME --cli $* | 9 | while os.path.islink(path): |
10 | return resolve(os.readlink(path)) | ||
11 | return path | ||
12 | |||
13 | CASPER_PATH = os.path.abspath(os.path.join(os.path.dirname(resolve(__file__)), '..')) | ||
14 | CASPER_ARGS = ['phantomjs', os.path.join(CASPER_PATH, 'casper.js'), '--casper-path=%s' % CASPER_PATH, '--cli'] | ||
15 | CASPER_ARGS.extend(sys.argv[1:]) | ||
16 | |||
17 | subprocess.call(CASPER_ARGS) | ... | ... |
... | @@ -33,7 +33,7 @@ | ... | @@ -33,7 +33,7 @@ |
33 | phantom.casperVersion = { | 33 | phantom.casperVersion = { |
34 | major: 0, | 34 | major: 0, |
35 | minor: 4, | 35 | minor: 4, |
36 | revision: 0, | 36 | revision: 1, |
37 | toString: function() { | 37 | toString: function() { |
38 | return [this.major, this.minor, this.revision].join('.'); | 38 | return [this.major, this.minor, this.revision].join('.'); |
39 | } | 39 | } | ... | ... |
-
Please register or sign in to post a comment