exit after initialisation
This commit is contained in:
parent
f2f244eb9d
commit
60fc1b90ca
6
app.js
6
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) {
|
||||
|
@ -1 +1 @@
|
||||
240
|
||||
241
|
Loading…
x
Reference in New Issue
Block a user