Skip to content
Snippets Groups Projects
Commit 69fcc11c authored by Rhys Arkins's avatar Rhys Arkins
Browse files

Support custom config

Helps #3
parent a4dbce4f
No related branches found
No related tags found
No related merge requests found
/node_modules /node_modules
/src/config.js
const semver = require('semver'); const semver = require('semver');
const stable = require('semver-stable'); const stable = require('semver-stable');
const config = require('./defaults');
const github = require('./helpers/github'); const github = require('./helpers/github');
const npm = require('./helpers/npm'); const npm = require('./helpers/npm');
const packageJson = require('./helpers/packageJson'); const packageJson = require('./helpers/packageJson');
npm.init(config);
// Process arguments // Process arguments
const repoName = process.argv[2]; const repoName = process.argv[2];
const packageFile = process.argv[3] || 'package.json'; const packageFile = process.argv[3] || 'package.json';
const token = process.env.RENOVATE_TOKEN; const token = process.env.RENOVATE_TOKEN;
validateArguments(); validateArguments();
const config = initConfig();
npm.init(config);
initializeGitHub() initGitHub()
.then(getPackageFileContents) .then(getPackageFileContents)
.then(determineUpgrades) .then(determineUpgrades)
.then(processUpgradesSequentially) .then(processUpgradesSequentially)
...@@ -42,7 +41,18 @@ function validateArguments() { ...@@ -42,7 +41,18 @@ function validateArguments() {
} }
} }
function initializeGitHub() { function initConfig() {
const defaultConfig = require('./defaults');
let customConfig = {};
try {
customConfig = require('./config');
} catch(e) {
// Do nothing
}
return Object.assign(defaultConfig, customConfig);
}
function initGitHub() {
if (config.verbose) { if (config.verbose) {
console.log('Initializing GitHub'); console.log('Initializing GitHub');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment