1 | ;
|
2 |
|
3 | const log = require("npmlog");
|
4 | const childProcess = require("@lerna/child-process");
|
5 |
|
6 | module.exports.gitTag = gitTag;
|
7 |
|
8 | /**
|
9 | * @param {string} tag
|
10 | * @param {{ forceGitTag: boolean; signGitTag: boolean; }} gitOpts
|
11 | * @param {import("@lerna/child-process").ExecOpts} opts
|
12 | */
|
13 | function gitTag(tag, { forceGitTag, signGitTag }, opts) {
|
14 | log.silly("gitTag", tag);
|
15 |
|
16 | const args = ["tag", tag, "-m", tag];
|
17 |
|
18 | if (forceGitTag) {
|
19 | args.push("--force");
|
20 | }
|
21 |
|
22 | if (signGitTag) {
|
23 | args.push("--sign");
|
24 | }
|
25 |
|
26 | log.verbose("git", args);
|
27 | return childProcess.exec("git", args, opts);
|
28 | }
|