-
Notifications
You must be signed in to change notification settings - Fork 14
/
bin.js
executable file
·38 lines (29 loc) · 712 Bytes
/
bin.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
30
31
32
33
34
35
36
37
38
#!/usr/bin/env node
require('dotenv').config()
const neodoc = require('neodoc')
const chrome = require('./lib/chrome')
const firefox = require('./lib/firefox')
const opera = require('./lib/opera')
const UserError = require('./lib/user-error')
const usage = `
Usage:
shipit chrome <source>
shipit firefox <source>
shipit opera <source>
`
async function main () {
const args = neodoc.run(usage)
if (args.chrome) {
await chrome(args['<source>'])
}
if (args.firefox) {
await firefox(args['<source>'])
}
if (args.opera) {
await opera(args['<source>'])
}
}
main().catch((err) => {
process.exitCode = 1
console.error((err instanceof UserError) ? err.message : err.stack)
})