-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.mjs
executable file
·54 lines (40 loc) · 1.03 KB
/
main.mjs
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
#!/usr/bin/env zx
import deps from "./cmd/deps.mjs";
import release from "./cmd/release.mjs";
const { green, red, yellow } = chalk;
try {
const [command, ...subcommands] = argv["_"];
const showHelp = argv["help"] || argv["h"] || false;
if (!command && showHelp) {
usage();
process.exit(0);
}
$.verbose = argv["verbose"] || argv["v"] || false;
switch (command) {
case "custom":
//TODO: enable ability to supply a file to run a custom script over a set of repositories
break;
case "deps":
deps(subcommands);
break;
case "release":
release(subcommands);
break;
default:
usage(subcommands);
break;
}
} catch (err) {
console.error(red(`${err}`));
}
function usage() {
console.log(`
Usage: ./main.mjs [command] <options>
Commands:
deps run update deps
release run the draft release process
Options:
-h, --help show the usage text for the current command
-v, --verbose display verbose output for debugging
`);
}