From c55584b09fb4d209ce5ac4cc1fa66e5b8f5e0b1c Mon Sep 17 00:00:00 2001 From: bashz Date: Sun, 20 Jan 2019 21:52:40 +0100 Subject: [PATCH] [bugfix] `generate new --without` splits the args twice --- lib/core-generators/new/before.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core-generators/new/before.js b/lib/core-generators/new/before.js index 9ad5b49d..891be503 100644 --- a/lib/core-generators/new/before.js +++ b/lib/core-generators/new/before.js @@ -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']; @@ -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);