don't use discouraged return outside of functions

This commit is contained in:
Evert Prants 2019-01-11 04:42:29 +02:00
parent 4617883f44
commit 4843ed06b2
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
1 changed files with 11 additions and 8 deletions

View File

@ -2,7 +2,8 @@
const path = require('path')
const config = require(path.join(__dirname, 'control', 'config.js'))
const env = 'development'
let env = 'development'
let start = true
// Config grabber
for (let i in process.argv) {
@ -15,17 +16,19 @@ for (let i in process.argv) {
process.exit(1)
}
)
return
start = false
} else if (arg === '-p') {
env = 'production'
break
}
}
// Application starter
process.env.NODE_ENV = env
if (start) {
// Application starter
process.env.NODE_ENV = env
config.read().then(
(c) => require(path.join(__dirname, 'control')),
(e) => console.error(e.stack)
)
config.read().then(
(c) => require(path.join(__dirname, 'control')),
(e) => console.error(e.stack)
)
}