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 53a5a97 commit b9f1c1cCopy full SHA for b9f1c1c
lib/utils.js
@@ -457,7 +457,10 @@ module.exports.isNotSet = function (obj) {
457
};
458
459
module.exports.emptyFolder = (directoryPath) => {
460
- require('child_process').execSync(`rm -rf ${directoryPath}/*`);
+ if (!fs.existsSync(directoryPath)) return;
461
+ for (const file of fs.readdirSync(directoryPath)) {
462
+ fs.rmSync(path.join(directoryPath, file), { recursive: true, force: true });
463
+ }
464
465
466
module.exports.printObjectProperties = (obj) => {
0 commit comments