fixed glob.sync in init.js

This commit is contained in:
David Baldwynn 2015-11-06 12:21:52 -08:00
parent b7bdd067b6
commit 7cffc84422
2 changed files with 17 additions and 21 deletions

View file

@ -14,18 +14,16 @@ module.exports = function() {
* Before we begin, lets set the environment variable * Before we begin, lets set the environment variable
* We'll Look for a valid NODE_ENV variable and if one cannot be found load the development NODE_ENV * We'll Look for a valid NODE_ENV variable and if one cannot be found load the development NODE_ENV
*/ */
glob('./config/env/' + process.env.NODE_ENV + '.js', { var environmentFiles = glob.sync('./config/env/' + process.env.NODE_ENV + '.js');
sync: true if (!environmentFiles.length) {
}, function(err, environmentFiles) { if (process.env.NODE_ENV) {
if (!environmentFiles.length) { console.error(chalk.red('No configuration file found for "' + process.env.NODE_ENV + '" environment using development instead'));
if (process.env.NODE_ENV) { } else {
console.error(chalk.red('No configuration file found for "' + process.env.NODE_ENV + '" environment using development instead')); console.error(chalk.red('NODE_ENV is not defined! Using default development environment'));
} else {
console.error(chalk.red('NODE_ENV is not defined! Using default development environment'));
}
process.env.NODE_ENV = 'development';
} }
});
process.env.NODE_ENV = 'development';
}
}; };

View file

@ -13,7 +13,7 @@
"url": "https://github.com/whitef0x0/NodeForms.git" "url": "https://github.com/whitef0x0/NodeForms.git"
}, },
"engines": { "engines": {
"node": "~0.12.6", "node": "~5.0.0",
"npm": "~2.11.2" "npm": "~2.11.2"
}, },
"scripts": { "scripts": {
@ -25,6 +25,7 @@
"async": "^1.4.2", "async": "^1.4.2",
"body-parser": "~1.14.1", "body-parser": "~1.14.1",
"bower": "~1.6.5", "bower": "~1.6.5",
"brace-expansion": "^1.1.1",
"chalk": "~1.1.1", "chalk": "~1.1.1",
"compression": "~1.6.0", "compression": "~1.6.0",
"connect-flash": "~0.1.1", "connect-flash": "~0.1.1",
@ -54,16 +55,15 @@
"grunt-nodemon": "~0.4.0", "grunt-nodemon": "~0.4.0",
"helmet": "~0.14.0", "helmet": "~0.14.0",
"load-grunt-tasks": "~3.3.0", "load-grunt-tasks": "~3.3.0",
"lodash": "~3.10.1", "lodash": "^2.4.1",
"mailosaur": "^1.0.1",
"main-bower-files": "~2.9.0", "main-bower-files": "~2.9.0",
"math": "0.0.3", "math": "0.0.3",
"method-override": "~2.3.0", "method-override": "~2.3.0",
"mocha": ">=1.20.0", "mocha": ">=1.20.0",
"mongoose": "~3.8.8", "mongoose": "~3.8.8",
"mongoose-utilities": "~0.1.1",
"morgan": "~1.6.1", "morgan": "~1.6.1",
"multer": "~0.1.8", "multer": "^0.1.8",
"pdffiller": "~0.1.1",
"nodemailer": "~1.8.0", "nodemailer": "~1.8.0",
"nools": "^0.4.1", "nools": "^0.4.1",
"passport": "~0.3.0", "passport": "~0.3.0",
@ -73,16 +73,14 @@
"passport-linkedin": "~1.0.0", "passport-linkedin": "~1.0.0",
"passport-local": "~1.0.0", "passport-local": "~1.0.0",
"passport-twitter": "~1.0.2", "passport-twitter": "~1.0.2",
"pdffiller": "~0.1.1",
"pkg-up": "^1.0.0",
"raven": "^0.8.1", "raven": "^0.8.1",
"request": "^2.60.0", "request": "^2.60.0",
"request-promise": "^1.0.2", "request-promise": "^1.0.2",
"satelize": "~0.1.1", "satelize": "~0.1.1",
"shortid": "^2.2.2", "shortid": "^2.2.2",
"should": "~4.1.0",
"soap": "^0.11.0", "soap": "^0.11.0",
"supertest": "~0.14.0",
"mongoose-utilities": "~0.1.1",
"supertest-session": "^1.0.0",
"swig": "~1.4.1", "swig": "~1.4.1",
"then-fs": "~2.0.0" "then-fs": "~2.0.0"
}, },