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
1 changed files with 14 additions and 5 deletions

19
op.js
View File

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