1 | ;
|
2 |
|
3 | const log = require("npmlog");
|
4 | const childProcess = require("@lerna/child-process");
|
5 |
|
6 | module.exports.getCurrentBranch = getCurrentBranch;
|
7 |
|
8 | /**
|
9 | * @param {import("@lerna/child-process").ExecOpts} opts
|
10 | */
|
11 | function getCurrentBranch(opts) {
|
12 | log.silly("getCurrentBranch");
|
13 |
|
14 | const branch = childProcess.execSync("git", ["rev-parse", "--abbrev-ref", "HEAD"], opts);
|
15 | log.verbose("currentBranch", branch);
|
16 |
|
17 | return branch;
|
18 | }
|