diff --git a/app/config/file.js b/app/config/file.js index 4c5f567ab42b80dd3d57a4e12ac0897e56daaf1c..bbba78f68d5a02dfb84e5168cc7438805fed0b87 100644 --- a/app/config/file.js +++ b/app/config/file.js @@ -1,14 +1,23 @@ const logger = require('winston'); +let configFile = process.env.RENOVATE_CONFIG_FILE || 'config'; +if (!isPathAbsolute(configFile)) { + configFile = `../../${configFile}`; +} + let config = {}; try { - // eslint-disable-next-line import/no-unresolved,global-require - config = require('../../config'); + // eslint-disable-next-line global-require,import/no-dynamic-require + config = require(configFile); } catch (err) { // Do nothing - logger.verbose('No custom config found'); + logger.verbose('Could not locate config file'); } logger.debug(`File config = ${JSON.stringify(config)}`); module.exports = config; + +function isPathAbsolute(path) { + return /^(?:\/|[a-z]+:\/\/)/.test(path); +}