Created
July 19, 2016 10:50
-
-
Save pichfl/411c98c3c81fd049c3bff82f697aa9ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const argv = require('minimist')(process.argv.slice(2)); | |
const readFileSync = require('fs').readFileSync; | |
const join = require('path').join; | |
const configFilePath = argv.config; | |
const config = JSON.parse(readFileSync(join(__dirname, '..', 'config.json'))); | |
if (configFilePath) { | |
// Read config file defined by param from disk | |
const configFile = readFileSync(configFilePath); | |
// Convert file content from JSON | |
const importedConfig = JSON.parse(configFile); | |
// Merge config with default config | |
Object.assign(config, importedConfig); | |
} | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment