diff --git a/lib/clean.js b/lib/clean.js index dbfa4dbb99..68c5508be7 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -2,14 +2,18 @@ const rm = require('rimraf') const log = require('npmlog') +const util = require('util') -function clean (gyp, argv, callback) { +async function clean (gyp, argv) { // Remove the 'build' dir - var buildDir = 'build' + const buildDir = 'build' log.verbose('clean', 'removing "%s" directory', buildDir) - rm(buildDir, callback) + return util.promisify(rm)(buildDir) } -module.exports = clean +module.exports = function (gyp, argv, callback) { + // no response expected + clean(gyp, argv).then(() => callback(), callback) +} module.exports.usage = 'Removes any generated build files and the "out" dir'