UNPKG

596 BJavaScriptView Raw
1"use strict";
2
3const log = require("npmlog");
4const childProcess = require("@lerna/child-process");
5
6module.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 */
13function 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}