added cleanMode script and fixed github workflow
This commit is contained in:
14
scripts/cleanMod.js
Normal file
14
scripts/cleanMod.js
Normal 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");
|
Reference in New Issue
Block a user