Skip to content

Commit

Permalink
adding mac support for -e
Browse files Browse the repository at this point in the history
  • Loading branch information
moschel committed Apr 20, 2011
1 parent 8bd3b74 commit 4abb1ff
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
13 changes: 12 additions & 1 deletion js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ then
shift
fi

ERRORLEV=0
if [ $1 = "-e" ]
then
ERRORLEV=1
shift
fi

if [ $1 = "-h" -o $1 = "-?" -o $1 = "--help" ]
then
echo Load a command line Rhino JavaScript environment or run JavaScript script files in Rhino.
Expand All @@ -37,7 +44,6 @@ echo -e "./js apps/[NAME]/compress.js\t\tCompress your application and generate
exit 127
fi


if [ $1 = "-d" ]
then
java -classpath steal/rhino/js.jar:steal/rhino/selenium-java-client-driver.jar org.mozilla.javascript.tools.debugger.Main
Expand All @@ -54,3 +60,8 @@ do
done
ARGS=$ARGS]
java -Xss1024k -cp $CP org.mozilla.javascript.tools.shell.Main -e _args=$ARGS -opt -1 -e 'load('"'"$1"'"')'

if [ $ERRORLEV = "1" -a $? = "1" ]
then
exit $?
fi
12 changes: 12 additions & 0 deletions rhino/loader
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/sh
# This script is the common JS loader

ERRORLEV=0
if [ $1 = "-e" ]
then
ERRORLEV=1
shift
fi

ARGS=[
for arg
do
Expand All @@ -14,3 +21,8 @@ ARGS=$ARGS]
#fi

java -Xmx170m -Xss1024k -cp $CP -Dbasepath=$BASE -Dcmd=$CMD org.mozilla.javascript.tools.shell.Main -opt -1 -e _args="$ARGS" -e 'load('"'"$LOADPATH"'"')'

if [ $ERRORLEV = "1" -a $? = "1" ]
then
exit $?
fi

0 comments on commit 4abb1ff

Please sign in to comment.