We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
emptyFolder
1 parent 1ad971c commit f27ad44Copy full SHA for f27ad44
lib/utils.js
@@ -477,7 +477,10 @@ module.exports.isNotSet = function (obj) {
477
}
478
479
module.exports.emptyFolder = directoryPath => {
480
- require('child_process').execSync(`rm -rf ${directoryPath}/*`)
+ if (!fs.existsSync(directoryPath)) return
481
+ for (const file of fs.readdirSync(directoryPath)) {
482
+ fs.rmSync(path.join(directoryPath, file), { recursive: true, force: true })
483
+ }
484
485
486
module.exports.printObjectProperties = obj => {
0 commit comments