htdocs/node/makeboards.js
2024-10-31 13:52:17 +00:00

19 lines
556 B
JavaScript

const boards = require("/srv/www/htdocs/board/boards.js");
const fs = require("fs");
const { pageTop, pageBottom } = require("/srv/www/htdocs/html.js")
console.log(boards);
for (let board = 0; board < boards.length; board++) {
console.log(boards[board]);
let boardPath = `/srv/www/htdocs/board/${boards[board]}`;
if (fs.existsSync(boardPath)) {
console.log(`Directory /${boards[board]}/ exists`)
} else {
console.log(`Directory /${boards[board]}/ doesn't exist... Creating`)
fs.mkdirSync(boardPath);
}
}