Line | |
---|
1 | #!/bin/sh |
---|
2 | # Usage: envjs <platorm> file.js [file2.js ...] |
---|
3 | ########################################################################### |
---|
4 | ENVJS_PLATFORM='node' |
---|
5 | |
---|
6 | # first arguments ($1) |
---|
7 | # may be a platform or is a file and the default platorm is used |
---|
8 | if [ -n "$1" ]; then |
---|
9 | if [ -n "$1" ]; then ENVJS_PLATFORM="$1"; shift; fi |
---|
10 | fi |
---|
11 | |
---|
12 | # Run envjs with the given platform |
---|
13 | ########################################################################### |
---|
14 | case "$ENVJS_PLATFORM" in |
---|
15 | |
---|
16 | "node") |
---|
17 | node envjs/node.js $@ |
---|
18 | ;; |
---|
19 | "rhino") |
---|
20 | java -Xmx512M -jar rhino/js.jar -opt -1 envjs/rhino.js $@ |
---|
21 | ;; |
---|
22 | "rhino-debug") |
---|
23 | java -cp rhino/js.jar org.mozilla.javascript.tools.debugger.Main envjs/rhino.js $@ |
---|
24 | ;; |
---|
25 | "spyd") |
---|
26 | python envjs/spydermonkey.py envjs/spydermonkey.js $@ |
---|
27 | ;; |
---|
28 | "rubyracer") |
---|
29 | ruby -rrubygems envjs/rubyracer.rb envjs/rubyracer.js $@ |
---|
30 | ;; |
---|
31 | "johnson") |
---|
32 | ruby -rrubygems envjs/johnson.rb envjs/johnson.js $@ |
---|
33 | ;; |
---|
34 | *) |
---|
35 | # platform default means $1 was actually a file |
---|
36 | node envjs/node.js $ENVJS_PLATFORM $@ |
---|
37 | ;; |
---|
38 | esac |
---|
39 | |
---|
Note: See
TracBrowser
for help on using the repository browser.