Skip to content

Commit

Permalink
cleanup plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Jan 30, 2017
1 parent d393a65 commit ef70721
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
'use strict';

const arrify = require('arrify');
const bluebird = require('bluebird');
const rimraf = require('rimraf');
const toArr = require('arrify');
const Promise = require('bluebird');
const del = Promise.promisify(require('rimraf'));

module.exports = function () {
// const del = fly.$.promisify(rimraf);
const del = bluebird.promisify(rimraf);

this.plugin('clear', {every: 0, files: 0}, function * (_, globs, opts) {
module.exports = function (fly) {
fly.plugin('clear', {every: 0, files: 0}, function * (_, globs, opts) {
opts = opts || {};
globs = arrify(globs);
yield bluebird.all(globs.map(g => del(g, opts)));
yield Promise.all(toArr(globs).map(g => del(g, opts)));
});
};

0 comments on commit ef70721

Please sign in to comment.