htdocs/node/makeboards.js

19 lines
556 B
JavaScript
Raw Normal View History

2024-10-31 14:52:17 +01:00
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);
}
}