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