Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes for env init for Jake tasks after app init refactor

  • Loading branch information...
commit e6399e010bdda1ac9ad9624a1b4d55309058e558 1 parent 24e8cf2
@mde mde authored
Showing with 22 additions and 3 deletions.
  1. +11 −1 gen/jakelib/env.jake
  2. +11 −2 lib/init/index.js
View
12 gen/jakelib/env.jake
@@ -23,7 +23,17 @@ namespace('env', function () {
});
task('app', ['config'], {async: true}, function () {
- require('../../lib/init').init(geddy, function () {
+ var opts = {
+ initItems: [
+ 'model'
+ , 'controller'
+ , 'router'
+ , 'i18n'
+ , 'mailer'
+ , 'localAppInit'
+ ]
+ };
+ require('../../lib/init').init(geddy, opts, function () {
complete();
});
});
View
13 lib/init/index.js
@@ -5,8 +5,12 @@ var utils = require('utilities');
// take a callback that runs the next one. When all finished
// call the original top-level callback for the whole init
// process
-exports.init = function (app, callback) {
- var items = [
+exports.init = function () {
+ var args = Array.prototype.slice.call(arguments)
+ , callback = args.pop()
+ , app = args.shift()
+ , opts = args.shift() || {}
+ , items = [
'checkCompat'
, 'build'
, 'router'
@@ -30,5 +34,10 @@ exports.init = function (app, callback) {
callback();
}
};
+ if (opts.initItems && opts.initItems.length) {
+ items = items.filter(function (item) {
+ return opts.initItems.indexOf(item) > -1;
+ });
+ }
initItem();
};
Please sign in to comment.
Something went wrong with that request. Please try again.