-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
29 lines (23 loc) · 673 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env node
'use strict'
var api = require('./lib/api')
var config = require('./lib/config')
var program = require('./lib/program')
var logger = require('./lib/logger').createLogger(config.getProjectConfigDirectory())
program
.usage('<command> [options]')
// Load commands from /command folder
require('./commands')(program)
// Process Commands
config.load()
.then(api.load)
.then((apiOptions) => {
if (process.argv.length < 3) {
program.outputHelp()
}
program.parse(process.argv)
})
.catch((err) => {
console.error('Uncaught error running program', err)
logger.error('Uncaught error running program', err, err.stack)
})