Skip to content

Commit

Permalink
Call done() callback only on dev mode (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablopunk committed Sep 11, 2017
1 parent c7258d9 commit 6faf274
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions template/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ gulp.task('build', done => {
// TODO: add remark-cli with -qfo options
// TODO: ensure depcheck, xo, pug-lint, remark lint called in lint task
runSequence('lint', 'css', ['img', 'js', 'static'], async () => {
if (!PROD && config.openInBrowser) {
await opn(config.urls.web, { wait: false });
if (PROD) {
if (config.openInBrowser) {

This comment has been minimized.

Copy link
@niftylettuce

niftylettuce Sep 11, 2017

Collaborator

I think this is a bug - you should simply have if (config.env === 'development' && config.openInBrowser) {

This comment has been minimized.

Copy link
@pablopunk

pablopunk Sep 11, 2017

Author Contributor

It's already if (!PROD) in master btw. Should I still change it to config.env === 'development'?

About merging conditionals: if (config.env === 'development' && config.openInBrowser) {, the done() function wouldn't be called if the user disables config.openInBrowser (even in dev env)

await opn(config.urls.web, { wait: false });
}
done();
}
done();
});
});

Expand Down

0 comments on commit 6faf274

Please sign in to comment.