File: lib/commands/new.js
// Generated by CoffeeScript 1.7.1
"use strict";
var Helpers, LineUp, New, Promise, helpers, lineup, _;
_ = require("lodash");
Promise = require("bluebird");
Helpers = require("../util/Helpers");
helpers = new Helpers();
LineUp = require("lineup");
lineup = new LineUp();
/**
* Class to fetch and run hooks registered for new process/command
* @class New
* @constructor
*/
New = (function() {
function New() {}
/**
* @method run
* @param args {Object} accept arguments passed with new command
* @description Entry point to new command and run all registered hooks
*/
New.prototype.run = function(args) {
helpers.sortModules("new").then(function(hooks_to_proccess) {
if (_.size(hooks_to_proccess) > 0) {
helpers.run("new", hooks_to_proccess, null, args);
} else {
lineup.log.warn("0 hooks configured for this proccess");
process.exit(1);
}
});
};
return New;
})();
module.exports = New;
