mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-22 09:05:41 +01:00
Updating responses.json loading.
This commit is contained in:
parent
e6fa7317d6
commit
79f42166dd
12
src/data.js
12
src/data.js
@ -32,16 +32,8 @@ function readBans() {
|
|||||||
|
|
||||||
function readCustomResponses() {
|
function readCustomResponses() {
|
||||||
// Load the responses file into the responses variable.
|
// Load the responses file into the responses variable.
|
||||||
var readFilePath = `./responses/${process.env.TENANT}.json`;
|
state.responses = require(`./${process.env.TENANT}.json`);
|
||||||
fs.readFile(readFilePath, 'utf8', function (err, data) {
|
logger.debug(`Loaded responses file for ${process.env.TENANT} from external source.`);
|
||||||
if (err) { throw err; }
|
|
||||||
if (data) {
|
|
||||||
state.responses = JSON.parse(data);
|
|
||||||
logger.debug(`Loaded responses file for ${process.env.TENANT} from external source.`);
|
|
||||||
} else {
|
|
||||||
logger.warn(`${readFilePath} appears to be an empty file.`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function flushWarnings() {
|
function flushWarnings() {
|
||||||
|
Loading…
Reference in New Issue
Block a user