Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] generate new --without splits the args twice #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/core-generators/new/before.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ module.exports = function before (scope, done) {
website: util.format('https://github.com/%s', owner)
});

// To avoid confusion, disable the `async` dependency by default.
if (!_.contains(scope.without, 'async')) {
scope.without = _.uniq((scope.without||[]).concat(['async']));
}

// Provide a shortcut for generating an extremely minimal Sails app.
if (scope.minimal) {
scope.without = ['i18n','orm','sockets','grunt','lodash','async','session','views'];
Expand Down Expand Up @@ -236,6 +231,11 @@ module.exports = function before (scope, done) {
return done(new Error('Couldn\'t create a new Sails app. The provided `without` option (`'+util.inspect(scope.without, {depth:null})+'`) is invalid.'));
}//-•

// To avoid confusion, disable the `async` dependency by default.
if (!_.contains(scope.without, 'async')) {
scope.without = _.uniq((scope.without||[]).concat(['async']));
}

// Reject unrecognized "without" entries
var LEGAL_WITHOUT_IDENTIFIERS = ['lodash', 'async', 'orm', 'sockets', 'grunt', 'i18n', 'session', 'views'];
var unrecognizedEntries = _.difference(scope.without, LEGAL_WITHOUT_IDENTIFIERS);
Expand Down