fixed copy error bug

This commit is contained in:
deadvey 2025-07-13 00:41:59 +01:00
parent 1ea18208f0
commit d75a74b7a8
2 changed files with 7 additions and 5 deletions

10
app.js
View File

@ -57,21 +57,23 @@ function initialise() {
fs.writeFileSync(`${__dirname}/posts.js`, `export const posts = []`)
}
try {
const users = require("./comments.js");
const comments = require("./comments.js");
}
catch (error) {
console.log("Creating comments file")
fs.writeFileSync(`${__dirname}/comments.js`, `export const comments = []\nexport const counter = 0`)
}
try {
const users = require("./config.js");
const config = require("./config.js");
}
catch (error) {
console.log("Copying the example config to config.js")
console.log("!!! PLEASE MODIFY config.js TO YOUR NEEDS !!!")
fs.copyFile('example-config.js', 'config.js')
fs.copyFile('example-config.js', 'config.js', (err) => {
console.log("Error copying file")
})
}
process.exit()
process.exit(0)
}
function get_userID(username) {

View File

@ -1 +1 @@
242
244