From 68dc6b9527698d3aaf0d0d61365c6b22360d015c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 30 Jun 2013 14:33:36 -0700 Subject: [PATCH] Make the build warn if attempting to combine `template` with other commands. Former-commit-id: be47695b4f5315725b6e5520c6ccf3544c220d3a --- build.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build.js b/build.js index 9f6dcd502..8c13cc5c2 100755 --- a/build.js +++ b/build.js @@ -2360,13 +2360,17 @@ } // report invalid command combinations invalidArgs = _.intersection(options, ['backbone', 'legacy', 'mobile', 'modern', 'underscore']); - if (invalidArgs.length > 1) { - warnings.push('The `' + invalidArgs.slice(0, -1).join('`, `') + '`' + (invalidArgs.length > 2 ? ',' : '') + ' and `' + _.last(invalidArgs) + '` commands may not be combined.'); + + if (isTemplate) { + invalidArgs.push('template'); + } + if (invalidArgs.length > 2) { + warnings.push('The `' + invalidArgs.slice(0, -1).join('`, `') + '`' + (invalidArgs.length > 2 ? ',' : '') + ' and `' + invalidArgs.slice(-1) + '` commands may not be combined.'); } // report invalid command entries _.forOwn({ 'category': { - 'entries': categories, + 'entries': categoryOptions, 'validEntries': allCategories }, 'exports': {