Skip to content

Commit

Permalink
fix: count commits made since creating branch
Browse files Browse the repository at this point in the history
  • Loading branch information
nbierdeman committed Jan 6, 2023
1 parent bfee86f commit 48210a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ let { stdout: DEFAULT_BRANCH } =
DEFAULT_BRANCH = DEFAULT_BRANCH.trim();

let { stdout: startCommitCount } =
await $`git rev-list --count ${CURRENT_BRANCH}`;
await $`git rev-list --count ${CURRENT_BRANCH} ^${DEFAULT_BRANCH}`;
startCommitCount = startCommitCount.trim();

const UID = crypto.randomBytes(4).toString("hex");
Expand Down Expand Up @@ -121,7 +121,7 @@ if (DRY_RUN) {
// reset feature branch after publishing an alpha release
if (DIST_TAG === "alpha") {
let { stdout: endCommitCount } =
await $`git rev-list --count ${CURRENT_BRANCH}`;
await $`git rev-list --count ${CURRENT_BRANCH} ^${DEFAULT_BRANCH}`;
endCommitCount = endCommitCount.trim();

const commitDelta = endCommitCount - startCommitCount;
Expand Down

0 comments on commit 48210a4

Please sign in to comment.