2019-07-24 23:00:03 -07:00
|
|
|
'use strict'
|
2012-03-12 21:10:40 -07:00
|
|
|
|
2023-11-03 07:03:57 -07:00
|
|
|
const fs = require('graceful-fs').promises
|
|
|
|
const log = require('./log')
|
2012-03-12 21:10:40 -07:00
|
|
|
|
2023-11-03 07:03:57 -07:00
|
|
|
async function clean (gyp, argv) {
|
2012-03-12 21:10:40 -07:00
|
|
|
// Remove the 'build' dir
|
2023-11-03 07:03:57 -07:00
|
|
|
const buildDir = 'build'
|
2012-04-17 17:14:25 -07:00
|
|
|
|
2012-06-15 10:00:30 -07:00
|
|
|
log.verbose('clean', 'removing "%s" directory', buildDir)
|
2025-04-10 14:36:22 -07:00
|
|
|
await fs.rm(buildDir, { recursive: true, force: true, maxRetries: 3 })
|
2012-03-12 21:10:40 -07:00
|
|
|
}
|
2019-07-24 23:00:03 -07:00
|
|
|
|
|
|
|
module.exports = clean
|
|
|
|
module.exports.usage = 'Removes any generated build files and the "out" dir'
|