Copy settings if they are not present
This commit is contained in:
parent
be059d3dcc
commit
0af926928a
1 changed files with 14 additions and 4 deletions
18
index.js
18
index.js
|
@ -1,9 +1,19 @@
|
|||
const m = require('minecraft-protocol')
|
||||
const settings = require('./settings.json')
|
||||
const generateUser = require('./util/usergen.js')
|
||||
const EventEmitter = require('node:events')
|
||||
const fs = require('fs')
|
||||
|
||||
if (!fs.readdirSync('.').includes('settings.json')) {
|
||||
console.log("Settings file is missing, using defaults.")
|
||||
fs.copyFileSync("settings_example.json", "settings.json")
|
||||
}
|
||||
|
||||
if (!fs.readdirSync('.').includes('secret.json')) {
|
||||
console.log("Secrets file is missing, using defaults.")
|
||||
fs.copyFileSync("secret_example.json", "secret.json")
|
||||
}
|
||||
|
||||
const m = require('minecraft-protocol')
|
||||
const generateUser = require('./util/usergen.js')
|
||||
const EventEmitter = require('node:events')
|
||||
const settings = require('./settings.json')
|
||||
module.exports.bot = []
|
||||
|
||||
const botplug = []
|
||||
|
|
Loading…
Reference in a new issue