From 95bcedf14b92a54f84e1212649afd6e65f93341f Mon Sep 17 00:00:00 2001 From: Akbar Yahya <11765082+akbaryahya@users.noreply.github.com> Date: Sat, 12 Nov 2022 13:43:53 +0800 Subject: [PATCH] add Retcode --- op.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/op.js b/op.js index 21230e4f..f399631a 100644 --- a/op.js +++ b/op.js @@ -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);