There is now a Makefile because I learnt make syntax

This commit is contained in:
2025-10-19 21:19:13 +01:00
parent cb7dcde7c5
commit 66423cb3c0
7 changed files with 46 additions and 166 deletions

View File

@@ -10,15 +10,8 @@ const { fromUnixTime, format, getUnixTime } = require("date-fns") // A date util
const ejs = require("ejs")
const func = require("./functions.js")
const data = require("./data.js")
const init = require("./initialise.js")
// There's only one possible argument, so we can just check if the user passed that one
// TODO I plan on adding more such as --help and --post so I should make this more robust at some point
if (process.argv[2] == "--first-time") {
init.initialise() // Creates any files such users.js, posts.js, comments.js or config.js if they are not present
}
// Define the modules now so they are global
let users // contains a list of users, each user is an object containing username,prettyname,hash and description
let posts // contains a list of posts,
@@ -37,7 +30,7 @@ if (config["data_storage"] == "json") {
// if they don't all import then
// inform the user to pass --first-time and exit with an error code
console.log("A file is missing!")
console.log("Run with --first-time to initialise the program")
console.log("Run 'make' to initialise the data files")
console.log(error)
process.exit(1)
}