don't use discouraged return outside of functions
This commit is contained in:
parent
4617883f44
commit
4843ed06b2
7
index.js
7
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,13 +16,14 @@ 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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (start) {
|
||||||
// Application starter
|
// Application starter
|
||||||
process.env.NODE_ENV = env
|
process.env.NODE_ENV = env
|
||||||
|
|
||||||
@ -29,3 +31,4 @@ 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