Skip to content

Commit

Permalink
REverted change to bin/sails.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mikermcneil committed Feb 13, 2014
1 parent 824664c commit 1ce1efe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 4 additions & 3 deletions bin/sails-generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var package = require('../package.json')
* Internally, uses ejs for rendering the various module templates.
*/

module.exports = function ( program ) {
module.exports = function ( ) {

// Build initial scope
var scope = {
Expand All @@ -40,18 +40,19 @@ module.exports = function ( program ) {


// Get command-line arguments
// from the arguments to this function
var cliArguments = Array.prototype.slice.call(arguments);

// Remove commander's extra argument
cliArguments.pop();
var commanderCmd = cliArguments.pop();

// Peel off the generatorType and the rest of the args
scope.generatorType = cliArguments.shift();
scope.args = cliArguments;

// Show usage if no generator type is defined
if (!scope.generatorType) {
program.usageMinusWildcard();
commanderCmd.usageMinusWildcard();
return;
}

Expand Down
4 changes: 1 addition & 3 deletions bin/sails.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ cmd = program.command('generate [something]');
cmd.unknownOption = NOOP;
cmd.description('');
cmd.usage('[something]');
cmd.action( function () {
require('./sails-generate')(cmd);
});
cmd.action( require('./sails-generate') );



Expand Down

0 comments on commit 1ce1efe

Please sign in to comment.