Updating responses.json loading.

This commit is contained in:
chris062689 2018-07-29 18:47:19 -04:00
parent e6fa7317d6
commit 79f42166dd
1 changed files with 2 additions and 10 deletions

View File

@ -32,16 +32,8 @@ function readBans() {
function readCustomResponses() {
// Load the responses file into the responses variable.
var readFilePath = `./responses/${process.env.TENANT}.json`;
fs.readFile(readFilePath, 'utf8', function (err, data) {
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.`);
}
});
state.responses = require(`./${process.env.TENANT}.json`);
logger.debug(`Loaded responses file for ${process.env.TENANT} from external source.`);
}
function flushWarnings() {