renovate/lib/config/file.js
Rhys Arkins 552b5e68c5 Refactor helpers (#382)
* Move yarn and npm helpers into branch worker

* Fix name

* Move package-json helper

* Update name

* Move changelog

* Move github-app

* Remove unused platform

* Move logger

* Fix lint
2017-06-29 07:29:41 +02:00

22 lines
512 B
JavaScript

const logger = require('../logger');
const path = require('path');
module.exports = {
getConfig,
};
function getConfig(env) {
let configFile = env.RENOVATE_CONFIG_FILE || 'config';
if (!path.isAbsolute(configFile)) {
configFile = `../../${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;
}