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 readme and recipes to reflect new Promise-oriented del #1220

Merged
merged 1 commit into from
Aug 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ var paths = {

// Not all tasks need to use streams
// A gulpfile is just another node program and you can use any package available on npm
gulp.task('clean', function(cb) {
gulp.task('clean', function() {
// You can use multiple globbing patterns as you would with `gulp.src`
del(['build'], cb);
return del(['build']);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth noting that del can accept a single string in these kinds of cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I explicitly added an array here because I noticed people kept calling del multiple times instead of using an array 🤦

});

gulp.task('scripts', ['clean'], function() {
Expand Down
6 changes: 3 additions & 3 deletions docs/recipes/delete-files-folder.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ In the gulpfile we want to clean out the contents of the `mobile` folder before
var gulp = require('gulp');
var del = require('del');

gulp.task('clean:mobile', function (cb) {
del([
gulp.task('clean:mobile', function () {
return del([
'dist/report.csv',
// here we use a globbing pattern to match everything inside the `mobile` folder
'dist/mobile/**/*',
// we don't want to clean this file though so we negate the pattern
'!dist/mobile/deploy.json'
], cb);
]);
});

gulp.task('default', ['clean:mobile']);
Expand Down
4 changes: 2 additions & 2 deletions docs/recipes/running-tasks-in-series.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Another example, which returns the stream instead of using a callback:
var gulp = require('gulp');
var del = require('del'); // rm -rf

gulp.task('clean', function(cb) {
del(['output'], cb);
gulp.task('clean', function() {
return del(['output']);
});

gulp.task('templates', ['clean'], function() {
Expand Down