2023-06-26 08:12:20 +00:00
|
|
|
const fs = require("fs");
|
|
|
|
|
2023-07-05 09:19:52 +00:00
|
|
|
const clearModules = (filePath) => {
|
2023-06-26 08:12:20 +00:00
|
|
|
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.");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-07-05 09:19:52 +00:00
|
|
|
clearModules("go.mod");
|
|
|
|
clearModules("exampleSite/go.mod");
|