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 path = require('path')
|
||||||
const config = require(path.join(__dirname, 'control', 'config.js'))
|
const config = require(path.join(__dirname, 'control', 'config.js'))
|
||||||
const env = 'development'
|
let env = 'development'
|
||||||
|
let start = true
|
||||||
|
|
||||||
// Config grabber
|
// Config grabber
|
||||||
for (let i in process.argv) {
|
for (let i in process.argv) {
|
||||||
@ -15,17 +16,19 @@ for (let i in process.argv) {
|
|||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return
|
start = false
|
||||||
} else if (arg === '-p') {
|
} else if (arg === '-p') {
|
||||||
env = 'production'
|
env = 'production'
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Application starter
|
if (start) {
|
||||||
process.env.NODE_ENV = env
|
// Application starter
|
||||||
|
process.env.NODE_ENV = env
|
||||||
|
|
||||||
config.read().then(
|
config.read().then(
|
||||||
(c) => require(path.join(__dirname, 'control')),
|
(c) => require(path.join(__dirname, 'control')),
|
||||||
(e) => console.error(e.stack)
|
(e) => console.error(e.stack)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user