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

del 2.x has no callback function #124

Open
KiT106 opened this issue Sep 30, 2016 · 1 comment
Open

del 2.x has no callback function #124

KiT106 opened this issue Sep 30, 2016 · 1 comment

Comments

@KiT106
Copy link

KiT106 commented Sep 30, 2016

// del 1.x
del(patterns, [options], callback)

// del 2.x
del(patterns, [options])

So, clean function should upgrade like:

// with del 1.x
function clean(path, done) {
    log('Cleaning: ' + $.util.colors.blue(path));
    del(path, done);
}

// with del 2.x
function clean(path) {
    return del(config.distribution.scripts);
}
@zakhttp
Copy link

zakhttp commented Jan 26, 2017

del 2.x supports promises, below is my implementation:

function clean(path, done) {
    log('Cleaning assets: ' + $.util.colors.blue(path));
    del(path)
        .then(function sucess() {
            done();
        })
        .catch(function failure(exception) {
            log('Cleaning assets exception: ' + exception);
        });
}

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

No branches or pull requests

2 participants