From 2c772d0f4c770bb1550d477da43bda397270d4e6 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 22 Jul 2013 07:16:04 -0700 Subject: [PATCH] Ensure build command `csp` cannot be combined with others like `underscore`. Former-commit-id: 97b6bd973323e086f1b6fdf3e40a7732804e2669 --- README.md | 2 +- build.js | 4 ++-- test/test-build.js | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c1f2973e3..c6cc30ac8 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}" lodash moduleId="underscore" ``` -All arguments, except `legacy` with `mobile`, `modern`, or `underscore`, may be combined.
+All arguments, except `backbone`, `csp`, `legacy`, `mobile`, `modern`, and `underscore`, may be combined.
Unless specified by `-o` or `--output`, all files created are saved to the current working directory. The following options are also supported: diff --git a/build.js b/build.js index 7eb916857..6caf82e9f 100644 --- a/build.js +++ b/build.js @@ -1150,7 +1150,7 @@ ' (e.g. `lodash settings="{interpolate:/{{([\\s\\S]+?)}}/g}"`)', ' lodash moduleId=... The AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates', '', - ' All arguments, except `backbone`, `legacy`, `mobile`, `modern`, and `underscore`, may be combined.', + ' All arguments, except `backbone`, `csp`, `legacy`, `mobile`, `modern`, and `underscore`, may be combined.', ' Unless specified by `-o` or `--output`, all files created are saved to the current working directory.', '', ' Options:', @@ -2650,7 +2650,7 @@ warnings.push('Invalid argument' + (invalidArgs.length > 1 ? 's' : '') + ' passed: ' + invalidArgs.join(', ')); } // report invalid command combinations - invalidArgs = _.intersection(options, ['backbone', 'legacy', 'mobile', 'modern', 'underscore']); + invalidArgs = _.intersection(options, ['backbone', 'csp', 'legacy', 'mobile', 'modern', 'underscore']); if (isTemplate) { invalidArgs.push('template'); diff --git a/test/test-build.js b/test/test-build.js index 9ffae8c45..1cd5ed935 100644 --- a/test/test-build.js +++ b/test/test-build.js @@ -505,6 +505,7 @@ }); commands = [ + 'csp backbone', 'mobile underscore', 'modern template=./*.jst' ]; @@ -1646,7 +1647,7 @@ }) ); - var reNonCombinable = /\b(?:backbone|legacy|mobile|modern|underscore)\b/; + var reNonCombinable = /\b(?:backbone|csp|legacy|mobile|modern|underscore)\b/; commands.forEach(function(origCommand) { _.each(['', 'mobile', 'modern', 'underscore'], function(otherCommand) {