This repository was archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.js
More file actions
61 lines (58 loc) · 1.68 KB
/
cli.js
File metadata and controls
61 lines (58 loc) · 1.68 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env node
const meow = require('meow')
const commands = require('./src/index.js')
const cli = meow(
`
static:
Description
This will install serve and add scripts to run serve and deploy your app.
Usage
$ sectionctl-helper static [build-dir] [options]
Options
--account, -a Section.io account ID
--app, -i Section.io application ID
Examples
# With NPX
$ npx "@section.io/sectionctl-helper" static build/ -a 1234 -i 5678
# Or with it installed in your node_modules
$ sectionctl-helper static build/ -a 1234 -i 5678
scripts:
Description:
If you don't want to use serve (ie if your app uses its own node.js webserver runtime), you can use this command to just add the scripts to your package.json.
Usage
$ sectionctl-helper scripts [options]
Options
--account, -a Section.io account ID
--app, -i Section.io application ID
Examples
# With NPX
$ npx "@section.io/sectionctl-helper" scripts -a 1234 -i 5678
# Or with it installed in your node_modules
$ sectionctl-helper scripts -a 1234 -i 5678
help:
Usage
$ npx "@section.io/sectionctl-helper" help
`,
{
flags: {
account: { type: 'number', alias: 'a' },
app: { type: 'number', alias: 'i' }
}
}
)
if (cli.input.length === 0) {
console.log(cli.help)
} else {
const command = cli.input[0]
switch (command) {
case 'static':
commands.static(cli)
break
case 'scripts':
commands.scripts(cli)
break
default:
console.log(cli.help)
break
}
}