add Retcode

This commit is contained in:
Akbar Yahya 2022-11-12 13:43:53 +08:00
parent 00497f72de
commit 95bcedf14b
No known key found for this signature in database
GPG Key ID: 0C9985FEC5C018C9

19
op.js
View File

@ -471,6 +471,7 @@ function clean_proto_gen() {
// all
files.forEach(function (file) {
var todoremove = false;
// main file
var found = json_gc_needed.find((j) => file.match(j.name));
if (found) {
@ -482,14 +483,22 @@ function clean_proto_gen() {
//console.log("Files sub are required: "+file);
} else {
found_needclean++;
try {
fs.unlinkSync(file);
//file removed
} catch (err) {
console.error(err);
if (file.match("Retcode")) {
console.log("found");
} else {
todoremove = true;
}
}
}
if (todoremove) {
try {
fs.unlinkSync(file);
//file removed
} catch (err) {
console.error(err);
}
}
});
//console.log(file_toaddmore);