-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·27 lines (22 loc) · 851 Bytes
/
Copy pathcli.js
File metadata and controls
executable file
·27 lines (22 loc) · 851 Bytes
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
#!/usr/bin/env node
const meow = require("meow")
const updateNotifier = require("update-notifier")
const KnownError = require("./lib/error")
const initCommand = require("./lib/cli/init-command")
const deployCommand = require("./lib/cli/deploy-command")
const distributeCommand = require("./lib/cli/distribute-command")
const ConfigurationPath = ".discharge.json"
const cli = meow(`
Usage
$ discharge init
$ discharge deploy
$ discharge distribute
`)
updateNotifier({ pkg: cli.pkg }).notify()
let command = cli.input[0]
switch (command) {
case undefined: return cli.showHelp()
case "init": return initCommand(ConfigurationPath).catch(KnownError.catch)
case "deploy": return deployCommand(ConfigurationPath).catch(KnownError.catch)
case "distribute": return distributeCommand(ConfigurationPath).catch(KnownError.catch)
}