Skip to content

Commit

Permalink
Fix commit range
Browse files Browse the repository at this point in the history
  • Loading branch information
Drarig29 committed Dec 21, 2020
1 parent 1680ce0 commit 4b6c247
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const printCommitLog = async (repoUrl, registryUrl, fromLatestTag) => {
};
}

let commitRangeText = `${revision}...master`;

let commits = log.split('\n')
.map(commit => {
const splitIndex = commit.lastIndexOf(' ');
Expand All @@ -37,6 +39,8 @@ const printCommitLog = async (repoUrl, registryUrl, fromLatestTag) => {

if (!fromLatestTag) {
const latestTag = await git.latestTag();
commitRangeText = `${revision}...${latestTag}`;

const versionBumpCommitName = latestTag.slice(1); // Name v1.0.1 becomes 1.0.1
const versionBumpCommitIndex = commits.findIndex(commit => commit.message === versionBumpCommitName);

Expand All @@ -54,7 +58,7 @@ const printCommitLog = async (repoUrl, registryUrl, fromLatestTag) => {
`- ${htmlEscape(commit.message)} ${commit.id}`
).join('\n') + `\n\n${repoUrl}/compare/${revision}...${nextTag}`;

const commitRange = util.linkifyCommitRange(repoUrl, `${revision}...master`);
const commitRange = util.linkifyCommitRange(repoUrl, commitRangeText);

console.log(`${chalk.bold('Commits:')}\n${history}\n\n${chalk.bold('Commit Range:')}\n${commitRange}\n\n${chalk.bold('Registry:')}\n${registryUrl}\n`);

Expand Down

0 comments on commit 4b6c247

Please sign in to comment.