in src/renderers/Utils.js [191:230]
removeRecursiveSync(dir: string, language: string) {
for (var i = 0, len = PATH_SKIP_AUTOGEN.length; i < len; i++) {
let match = dir.match(PATH_SKIP_AUTOGEN[i]);
if (match) {
return false;
}
}
let version_file = versionPath[language]['base_path'] + '/' + versionPath[language]['file_path'];
let match = dir.includes(version_file);
if (match) {
return false;
}
let stats;
try {
stats = fs.lstatSync(dir);
} catch (e) {
if (e.code !== 'ENOENT') {
throw e;
}
return false;
}
if (stats.isDirectory()) {
let delete_all = true;
fs.readdirSync(dir).forEach(file =>
delete_all &= Utils.removeRecursiveSync(path.join(dir, file), language),
);
if (delete_all) {
fs.rmdirSync(dir);
} else {
return false;
}
} else {
fs.unlinkSync(dir);
}
return true;
},