init.initialise() checks for correct path of config.json (bug fix)

This commit is contained in:
2025-08-09 12:51:43 +01:00
parent 144c276bc9
commit 49c7fc7cdf
2 changed files with 3 additions and 39 deletions

View File

@@ -28,12 +28,12 @@ export function initialise() {
fs.writeFileSync(`../data/comments.json`, `{\n"comments": [],\n"counter": 0}`)
}
try {
const config = require("../data/config.json");
const config = require("../config.json");
}
catch (error) {
console.log("Copying the example config to config.js")
console.log("!!! PLEASE MODIFY config.js TO YOUR NEEDS !!!")
fs.copyFile('example-config.json', 'config.json', (err) => {
console.log("!!! PLEASE MODIFY config.json TO YOUR NEEDS !!!")
fs.copyFile('../example-config.json', '../config.json', (err) => {
console.log("Error copying file")
})
}