Permalink
Browse files

If node is available then use it to run r.js otherwise use java

  • Loading branch information...
1 parent 67712e6 commit 9f1bb77acfa4a3436aef31b53f97a8f2443d9029 @gseguin gseguin committed Feb 3, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 Makefile
View
@@ -19,9 +19,16 @@ deploy: STRUCTURE = jquery.mobile.structure-${VER_OFFICIAL}
# The CSS theme being used
THEME = default
-RUN_JS = @@java -XX:ReservedCodeCacheSize=64m -classpath build/js.jar:build/google-compiler-20111003.jar org.mozilla.javascript.tools.shell.Main
-#RUN_JS = @@node
-
+# If node is available then use node to run r.js
+# otherwise use good old rhino/java
+NODE = /usr/local/bin/node
+HAS_NODE = $(shell if test -x ${NODE} ;then echo true; fi)
+
+ifeq ($(HAS_NODE), true)
+ RUN_JS = @@node
+else
+ RUN_JS = @@java -XX:ReservedCodeCacheSize=64m -classpath build/js.jar:build/google-compiler-20111003.jar org.mozilla.javascript.tools.shell.Main
+endif
# Build Targets

3 comments on commit 9f1bb77

Contributor

johnbender commented on 9f1bb77 Feb 3, 2012

nitpick

Is there a reason for the direct path ref instead of just doing a which node and checking the exit status? I'm thinking that if the node path moves or we switch servers this will break.

Member

gseguin replied Feb 3, 2012

no reason, let me change that

Member

gseguin replied Feb 3, 2012

heh: which: no node in (/sbin:/usr/sbin:/bin:/usr/bin)
I guess that would be a reason to put the absolute path ;) I'll revert my last commit.

Please sign in to comment.