-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.js
executable file
·44 lines (38 loc) · 1.12 KB
/
cli.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
39
40
41
42
43
44
#!/usr/bin/env node
import { program } from 'commander';
import { readFile } from 'fs/promises';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { join } from 'path';
const pkg = JSON.parse(
await readFile(join(dirname(fileURLToPath(import.meta.url)), 'package.json')),
);
import guides from './projects/guides.js';
import guidesSearch from './projects/guides-search.js';
program
.name(pkg.name)
.description(pkg.description)
.version(pkg.version)
.option(
'--dry-run',
'Run the deploy pipeline without actually deploying. Useful for understanding all the necessary steps, or when working on the pipeline itself',
);
program
.command('guides')
.description('Deploy the new version for https://guides.emberjs.com')
.action((args, commandOptions) =>
guides(args, {
...program.opts(),
...commandOptions,
}),
);
program
.command('guides-search')
.description('Update Algolia indexes for https://guides.emberjs.com')
.action((args, commandOptions) =>
guidesSearch(args, {
...program.opts(),
...commandOptions,
}),
);
program.parse();