added cleanMode script and fixed github workflow

This commit is contained in:
somrat sorkar
2023-06-26 14:12:20 +06:00
parent aa471f8846
commit 56959fd77a
5 changed files with 41 additions and 31 deletions

14
scripts/cleanMod.js Normal file
View File

@@ -0,0 +1,14 @@
const fs = require("fs");
const clearMode = (filePath) => {
if (fs.existsSync(filePath)) {
let fileContent = fs.readFileSync(filePath, "utf8");
fileContent = fileContent.replace(/require\s*\([\s\S]*?\)/, "");
fs.writeFileSync(filePath, fileContent, "utf8");
} else {
console.log("File does not exist.");
}
};
clearMode("go.mod");
clearMode("exampleSite/go.mod");