renovate/lib/config/file.js

22 lines
486 B
JavaScript
Raw Normal View History

const path = require('path');
2017-01-14 13:39:26 +00:00
module.exports = {
getConfig,
};
2017-01-15 07:52:21 +00:00
function getConfig(env) {
let configFile = env.RENOVATE_CONFIG_FILE || 'config';
if (!path.isAbsolute(configFile)) {
configFile = `${process.cwd()}/${configFile}`;
}
let config = {};
try {
// eslint-disable-next-line global-require,import/no-dynamic-require
config = require(configFile);
} catch (err) {
// Do nothing
logger.debug('Could not locate config file');
}
return config;
2017-01-14 13:39:26 +00:00
}