Skip to content

Commit

Permalink
fix(files): Fix regression where strings from the CLI files option ar…
Browse files Browse the repository at this point in the history
…e no-longer exploded if they enter as an array - fixes  #1076
  • Loading branch information
shakyShane committed Apr 25, 2016
1 parent f1baae1 commit 5333848
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cli/cli-options.js
Expand Up @@ -297,7 +297,9 @@ opts.makeFilesArg = function (value) {
if (isList(value) && value.size) {
value.forEach(function (value) {
if (_.isString(value)) {
globs.push(value);
globs = globs.concat(
opts.utils.explodeFilesArg(value)
);
} else {
if (isMap(value)) {
objs.push(value);
Expand Down
7 changes: 7 additions & 0 deletions test/specs/cli/cli.options.files.js
Expand Up @@ -13,6 +13,13 @@ describe("CLI: Options: Merging Options: Files", function () {
objs: []
});
});
it("should return the files property from Array given with strings in legacy format", function () {
var imm = merge({files: ["css/*.css,*.html"]});
assert.deepEqual(imm.get("files").get("core").toJS(), {
globs: ["css/*.css", "*.html"],
objs: []
});
});
it("should return the files property from array given", function () {
var imm = merge({files: ["css/*.css", "*.html"]});
assert.deepEqual(imm.get("files").get("core").toJS(), {
Expand Down

0 comments on commit 5333848

Please sign in to comment.