Skip to content

Commit

Permalink
remove necessity for specifying empty post in flow
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanebachelier committed Apr 13, 2015
1 parent d6ed1d2 commit 234d796
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
19 changes: 15 additions & 4 deletions tasks/usemin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,23 @@ var getFlowFromConfig = function (config, target) {
post: {}
});
if (config.options && config.options.flow) {
var steps;
var post;

if (config.options.flow[target]) {
flow.setSteps(config.options.flow[target].steps);
flow.setPost(config.options.flow[target].post);
steps = config.options.flow[target].steps;
post = config.options.flow[target].post;
} else {
flow.setSteps(config.options.flow.steps);
flow.setPost(config.options.flow.post);
steps = config.options.flow.steps;
post = config.options.flow.post;
}

if (steps) {
flow.setSteps(steps);
}

if (post) {
flow.setPost(post);
}
}
return flow;
Expand Down
9 changes: 3 additions & 6 deletions test/test-usemin-prepare.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ describe('useminPrepare', function () {
flow: {
steps: {
js: ['uglify']
},
post: {}
}
}
}
});
Expand Down Expand Up @@ -257,8 +256,7 @@ describe('useminPrepare', function () {
html: {
steps: {
js: ['uglify']
},
post: {}
}
}
}
}
Expand Down Expand Up @@ -302,8 +300,7 @@ describe('useminPrepare', function () {
flow: {
steps: {
js: [copy]
},
post: {}
}
}
}
});
Expand Down

0 comments on commit 234d796

Please sign in to comment.