Copy settings if they are not present

This commit is contained in:
7cc5c4f330d47060 2024-08-22 13:50:44 -04:00
parent be059d3dcc
commit 0af926928a
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA

View file

@ -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 = []