Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0.0 and NODE_ENV processing fix #295

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iofogcontroller",
"version": "0.9.5",
"version": "1.0.0",
"description": "ioFog Controller project for Eclipse IoFog @ iofog.org \\nCopyright (c) 2018 Edgeworx, Inc.",
"main": "./src/main.js",
"author": "Saeid Baghbidi",
Expand Down Expand Up @@ -39,6 +39,7 @@
"build": "export NODE_ENV=production && cd src/sequelize && ../../node_modules/.bin/sequelize db:migrate && ../../node_modules/.bin/sequelize db:seed:all",
"start-dev": "NODE_ENV=development node ./src/main.js",
"build-dev": "export NODE_ENV=development && cd src/sequelize && ../../node_modules/.bin/sequelize db:migrate && ../../node_modules/.bin/sequelize db:seed:all",
"postinstall": "export NODE_ENV=production && cd src/sequelize && ../../node_modules/.bin/sequelize db:migrate && ../../node_modules/.bin/sequelize db:seed:all",
"lint": "./node_modules/.bin/eslint \"**/*.js\""
},
"preferGlobal": true,
Expand Down
8 changes: 4 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
*
*/

if (!process.env.NODE_ENV) {
process.env.NODE_ENV = 'production'
}

const daemonize = require('daemonize2')
const Cli = require('./cli')
const logger = require('./logger')
Expand Down Expand Up @@ -50,8 +54,4 @@ function main() {
cli.run(daemon)
}

if (!process.env.NODE_ENV) {
process.env.NODE_ENV = 'production'
}

main()
2 changes: 1 addition & 1 deletion src/sequelize/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs');
const path = require('path');
const Sequelize = require('sequelize');
const basename = path.basename(__filename);
const env = process.env.NODE_ENV || 'development';
const env = process.env.NODE_ENV;
const config = require(__dirname + '/../config/config.json')[env];
const db = {};

Expand Down