added project-setup script

This commit is contained in:
somrat sorkar
2023-07-05 15:19:52 +06:00
parent dd723881c8
commit 8bc0dd868f
19 changed files with 251 additions and 259 deletions

14
scripts/clearModules.js Normal file
View File

@@ -0,0 +1,14 @@
const fs = require("fs");
const clearModules = (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.");
}
};
clearModules("go.mod");
clearModules("exampleSite/go.mod");