forked from bchr02/node-pre-gyp-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode-pre-gyp-github.js
More file actions
executable file
·27 lines (24 loc) · 904 Bytes
/
node-pre-gyp-github.js
File metadata and controls
executable file
·27 lines (24 loc) · 904 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
import NodePreGypGithub from '../index.js';
import { program } from "commander";
program
.command("publish")
.description("publishes the contents of ./build/stage/{version} to the current version's GitHub release")
.option("-r, --release", "publish immediately, do not create draft")
.option("-s, --silent", "turns verbose messages off")
.option("-c, --commitish <branch>", "specify the branch for target_commitish, defaults to 'main'")
.action(async (options) => {
const opts = {
draft: !options.release,
verbose: !options.silent,
commitish: options.commitish || 'main'
};
try {
const nodePreGypGithub = new NodePreGypGithub();
await nodePreGypGithub.publish(opts);
} catch (err) {
console.error(`An error occurred whilst publishing:`, err);
process.exit(1);
}
});
await program.parseAsync(process.argv);