Skip to content

Commit 45696c2

Browse files
committed
feat: Add toggle whether artifact includes branch
BREAKING CHANGE: master branch name option has changed to dontAppendBranchName. When set to true branch name won't be added to the artifact name. closes FXST-3547
1 parent 2000a2d commit 45696c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

caplin-versioning/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function getCommitCount() {
1414
return execSync("git rev-list --count HEAD", execOptions).trim();
1515
}
1616

17-
function getBranchDescriptor(defaultBranchName = "master") {
17+
function getBranchDescriptor(dontAppendBranchName) {
1818
let stdout;
1919

2020
// This approach to generating a version relies on the project being stored
@@ -38,11 +38,11 @@ function getBranchDescriptor(defaultBranchName = "master") {
3838
// To prevent a trailing `-` being suffixed to the version if a
3939
// `branchDescriptor` is available we prefix the descriptor with `-` if it
4040
// exists else return a blank string.
41-
return currentBranch === defaultBranchName ? "" : `-${currentBranch}`;
41+
return dontAppendBranchName ? "" : `-${currentBranch}`;
4242
}
4343

44-
module.exports = (semVer, { hashLength, masterBranchName } = {}) => {
45-
const branchDescriptor = getBranchDescriptor(masterBranchName);
44+
module.exports = (semVer, { hashLength, dontAppendBranchName } = {}) => {
45+
const branchDescriptor = getBranchDescriptor(dontAppendBranchName);
4646
const commitCount = getCommitCount();
4747
const hash = getHash(hashLength);
4848

0 commit comments

Comments
 (0)