From 9dfd96b84fc4ec2f0f61db08e2707f3305c6819f Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 13 Feb 2015 09:24:16 -0600 Subject: [PATCH 1/4] Moved and configured config.json to be in root of directory --- website/config.json.example => config.json.example | 0 website/src/utils.js | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename website/config.json.example => config.json.example (100%) diff --git a/website/config.json.example b/config.json.example similarity index 100% rename from website/config.json.example rename to config.json.example diff --git a/website/src/utils.js b/website/src/utils.js index 55cab68ede..7a919977a5 100644 --- a/website/src/utils.js +++ b/website/src/utils.js @@ -1,5 +1,6 @@ var nodemailer = require('nodemailer'); var nconf = require('nconf'); +nconf.file({ file: './config.json' }); var crypto = require('crypto'); var path = require("path"); var request = require('request'); @@ -142,4 +143,4 @@ module.exports.decrypt = function(text){ var dec = decipher.update(text,'hex','utf8') dec += decipher.final('utf8'); return dec; -} \ No newline at end of file +} From ca50c31bc09d51aec3fabf15a7bd687395a3388d Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 13 Feb 2015 09:31:56 -0600 Subject: [PATCH 2/4] Adjusted grunt command so it behaves differently on production and development --- Gruntfile.js | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index ba81aaf62e..842817f3bb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,6 @@ /*global module:false*/ var _ = require('lodash'); +var config = require('./config'); module.exports = function(grunt) { // Ported from shared @@ -234,6 +235,11 @@ module.exports = function(grunt) { grunt.registerTask('run:dev', [ 'build:dev', 'concurrent' ]); + if(config.NODE_ENV == 'production') + grunt.registerTask('default', ['build:prod']); + else + grunt.registerTask('default', ['build:dev']); + // Load tasks grunt.loadNpmTasks('grunt-browserify'); grunt.loadNpmTasks('grunt-contrib-uglify'); diff --git a/package.json b/package.json index d426e1b28c..c12791cb65 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "scripts": { "test": "./test/run_tests.sh", "start": "grunt run:dev", - "postinstall": "./node_modules/bower/bin/bower --config.interactive=false install -f; ./node_modules/.bin/grunt build:prod;", + "postinstall": "./node_modules/bower/bin/bower --config.interactive=false install -f; ./node_modules/.bin/grunt;", "coverage": "COVERAGE=true mocha --require register-handlers.js --reporter html-cov > coverage.html; open coverage.html" }, "devDependencies": { From 7cf87453755904261a8bed412260c1d9a1e936b4 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 13 Feb 2015 09:43:28 -0600 Subject: [PATCH 3/4] Corrected gruntfile to use process.env.NODE_ENV --- Gruntfile.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 842817f3bb..2fe125c003 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,6 +1,5 @@ /*global module:false*/ var _ = require('lodash'); -var config = require('./config'); module.exports = function(grunt) { // Ported from shared @@ -235,7 +234,7 @@ module.exports = function(grunt) { grunt.registerTask('run:dev', [ 'build:dev', 'concurrent' ]); - if(config.NODE_ENV == 'production') + if(process.env.NODE_ENV == 'production') grunt.registerTask('default', ['build:prod']); else grunt.registerTask('default', ['build:dev']); From 84ce4bb5d8ff3e934e9eb39586cd5209f71078da Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 13 Feb 2015 09:45:18 -0600 Subject: [PATCH 4/4] Corrected path to config.json --- website/src/utils.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/website/src/utils.js b/website/src/utils.js index 7a919977a5..9255223209 100644 --- a/website/src/utils.js +++ b/website/src/utils.js @@ -1,6 +1,5 @@ var nodemailer = require('nodemailer'); var nconf = require('nconf'); -nconf.file({ file: './config.json' }); var crypto = require('crypto'); var path = require("path"); var request = require('request'); @@ -117,7 +116,7 @@ module.exports.setupConfig = function(){ nconf.argv() .env() //.file('defaults', path.join(path.resolve(__dirname, '../config.json.example'))) - .file('user', path.join(path.resolve(__dirname, '../config.json'))); + .file('user', path.join(path.resolve(__dirname, './../../config.json'))); if (nconf.get('NODE_ENV') === "development") Error.stackTraceLimit = Infinity;