diff --git a/app.js b/app.js index 10943bdc..a607049a 100755 --- a/app.js +++ b/app.js @@ -5,6 +5,11 @@ var fs = require('fs'); var _ = require('underscore'); +// jshint undef:false +var log = console.log.bind(console); +var logError = console.error.bind(console); +// jshint undef:true + var argv = require('yargs') .usage('Usage: $0 [options]') .help('h') @@ -21,7 +26,7 @@ var argv = require('yargs') var environmentArg = argv._[0] || process.env.NODE_ENV || 'development'; var configurationFile = path.resolve(argv.config || './config/environments/' + environmentArg + '.js'); if (!fs.existsSync(configurationFile)) { - console.error('Configuration file "%s" does not exist', configurationFile); + logError('Configuration file "%s" does not exist', configurationFile); process.exit(1); } @@ -29,11 +34,6 @@ global.environment = require(configurationFile); var ENVIRONMENT = argv._[0] || process.env.NODE_ENV || global.environment.environment; process.env.NODE_ENV = ENVIRONMENT; -// jshint undef:false -var log = console.log.bind(console); -var logError = console.error.bind(console); -// jshint undef:true - var availableEnvironments = { production: true, staging: true,