fixed copy error bug
This commit is contained in:
parent
1ea18208f0
commit
d75a74b7a8
10
app.js
10
app.js
@ -57,21 +57,23 @@ function initialise() {
|
|||||||
fs.writeFileSync(`${__dirname}/posts.js`, `export const posts = []`)
|
fs.writeFileSync(`${__dirname}/posts.js`, `export const posts = []`)
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const users = require("./comments.js");
|
const comments = require("./comments.js");
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log("Creating comments file")
|
console.log("Creating comments file")
|
||||||
fs.writeFileSync(`${__dirname}/comments.js`, `export const comments = []\nexport const counter = 0`)
|
fs.writeFileSync(`${__dirname}/comments.js`, `export const comments = []\nexport const counter = 0`)
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const users = require("./config.js");
|
const config = require("./config.js");
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.log("Copying the example config to config.js")
|
console.log("Copying the example config to config.js")
|
||||||
console.log("!!! PLEASE MODIFY config.js TO YOUR NEEDS !!!")
|
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) {
|
function get_userID(username) {
|
||||||
|
@ -1 +1 @@
|
|||||||
242
|
244
|
Loading…
x
Reference in New Issue
Block a user