From 60fc1b90caa6cba8b73a5e7c88805afd8441037b Mon Sep 17 00:00:00 2001 From: deadvey Date: Sun, 13 Jul 2025 00:25:19 +0100 Subject: [PATCH] exit after initialisation --- app.js | 6 ++++++ hitcount.txt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index dc4b8dc..9facda8 100755 --- a/app.js +++ b/app.js @@ -46,26 +46,32 @@ function initialise() { const users = require("./users.js"); } catch (error) { + console.log("Creating users file") fs.writeFileSync(`${__dirname}/users.js`, `export const users = []`) } try { const posts = require("./posts.js"); } catch (error) { + console.log("Creating posts file") fs.writeFileSync(`${__dirname}/posts.js`, `export const posts = []`) } try { const users = 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"); } 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') } + process.exit() } function get_userID(username) { diff --git a/hitcount.txt b/hitcount.txt index eaea6f5..9ce0f49 100644 --- a/hitcount.txt +++ b/hitcount.txt @@ -1 +1 @@ -240 \ No newline at end of file +241 \ No newline at end of file