Last active
August 29, 2015 14:01
-
-
Save qubyte/87c9825abc291363dfa6 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
var config = require('minimist')(process.argv.slice(2)); | |
module.exports = config; | |
var errors = []; | |
if (!config.hasOwnProperty('twitter-consumer-key')) { | |
errors.push('No twitter-consumer-key given.'); | |
} | |
if (!config.hasOwnProperty('twitter-consumer-secret')) { | |
errors.push('No twitter-consumer-secret given.'); | |
} | |
if (!config.hasOwnProperty('twitter-access-token')) { | |
errors.push('No twitter-access-token given.'); | |
} | |
if (!config.hasOwnProperty('twitter-access-token-secret')) { | |
errors.push('No twitter-access-token-secret given.'); | |
} | |
// Log critical error messages and exit. | |
if (errors.length) { | |
errors.forEach(function (message) { | |
console.error(message); | |
}); | |
process.exit(1); | |
} | |
// Handle default configuration. | |
if (!config.hasOwnProperty('workers')) { | |
config.workers = 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment