status-github-bot/lib/config.js

23 lines
418 B
JavaScript
Raw Normal View History

2018-01-22 17:22:32 +00:00
// Description:
// Configuration-related functionality
//
// Dependencies:
// js-yaml: "^3.10.0"
//
// Author:
// PombeirP
module.exports = (robot, fileName) => {
// Get document, or throw exception on error
try {
const yaml = require('js-yaml');
const fs = require('fs');
return yaml.safeLoad(fs.readFileSync(fileName, 'utf8'));
} catch (e) {
robot.log.error(e);
}
return null;
}