don't use discouraged return outside of functions
This commit is contained in:
parent
4617883f44
commit
4843ed06b2
19
index.js
19
index.js
@ -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)
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user