Permalink
Browse files

Add `then-jade` as an alternative to `jade`

First looks for `jade` then falls back to `then-jade` if `jade` is not
found.
  • Loading branch information...
1 parent 384c596 commit dd41daccacb88ac3c49833d024625ce7c2bad6b6 @ForbesLindesay ForbesLindesay committed Jan 5, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/consolidate.js
View
@@ -153,7 +153,14 @@ function fromStringRenderer(name) {
*/
exports.jade = function(path, options, fn){
- var engine = requires.jade || (requires.jade = require('jade'));
+ var engine = requires.jade;
+ if (!engine) {
+ try {
+ engine = requires.jade = require('jade');
+ } catch (err) {
+ engine = requires.jade = require('then-jade');
+ }
+ }
engine.renderFile(path, options, fn);
};

0 comments on commit dd41dac

Please sign in to comment.