Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update del usage with promise #761

Merged
merged 1 commit into from
Sep 11, 2015
Merged

Update del usage with promise #761

merged 1 commit into from
Sep 11, 2015

Conversation

zckrs
Copy link
Collaborator

@zckrs zckrs commented Sep 9, 2015

No description provided.

@MrBuBBLs
Copy link

MrBuBBLs commented Sep 9, 2015

This fixes an issue with the 2.x version of the del module and looks good as is.
But why use the callback function when you can 'return' its results to fullfill the promise ?

As illustrated there : https://github.com/gulpjs/gulp/blob/master/docs/recipes/delete-files-folder.md

In JS:

gulp.task('clean', function () {
<% if (props.jsPreprocessor.key === 'typescript') { -%>
  return $.del([path.join(conf.paths.dist, '/'), path.join(conf.paths.tmp, '/partials'), path.join(conf.paths.tmp, '/serve')]);
<% } else { -%>
  return $.del([path.join(conf.paths.dist, '/'), path.join(conf.paths.tmp, '/')]);
<% } -%>
});

@zckrs
Copy link
Collaborator Author

zckrs commented Sep 9, 2015

Nice catch. Thank you.

@Swiip
Copy link
Owner

Swiip commented Sep 9, 2015

👍

@MrBuBBLs
Copy link

MrBuBBLs commented Sep 9, 2015

@zckrs You're welcome :)

Swiip added a commit that referenced this pull request Sep 11, 2015
Update del usage with promise
@Swiip Swiip merged commit 2fb6716 into Swiip:master Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants