32 lines
624 B
JavaScript
32 lines
624 B
JavaScript
|
#!/usr/bin/env node
|
||
|
|
||
|
const path = require('path')
|
||
|
const config = require(path.join(__dirname, 'control', 'config.js'))
|
||
|
const env = 'development'
|
||
|
|
||
|
// Config grabber
|
||
|
for (let i in process.argv) {
|
||
|
let arg = process.argv[i]
|
||
|
if (arg === '-c') {
|
||
|
config.liq().then(
|
||
|
(dat) => console.log(dat),
|
||
|
(err) => {
|
||
|
console.error(err.stack)
|
||
|
process.exit(1)
|
||
|
}
|
||
|
)
|
||
|
return
|
||
|
} else if (arg === '-p') {
|
||
|
env = 'production'
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Application starter
|
||
|
process.env.NODE_ENV = env
|
||
|
|
||
|
config.read().then(
|
||
|
(c) => require(path.join(__dirname, 'control')),
|
||
|
(e) => console.error(e.stack)
|
||
|
)
|