fix(commands): incorrect changelog version generation

This commit is contained in:
2023-08-20 03:48:54 +03:00
parent b05591a316
commit 7a5880d211
3 changed files with 72 additions and 39 deletions

View File

@@ -13,8 +13,9 @@ import {
import fs from "fs";
import path from "path";
import { CommitStack, Config } from "./types";
import simpleGit, { DefaultLogFields, ListLogLine } from "simple-git";
import simpleGit from "simple-git";
import { Command } from "commander";
import semver from "semver";
const GetConfig = async () => {
if (fs.existsSync(path.join(process.cwd(), ".rczrc"))) {
@@ -209,8 +210,9 @@ program
console.log("# Changelog");
for (const commit of commits) {
const tag = (await simpleGit().tags([`--contains=${commit.hash}`]))
.latest!;
const tag = semver.sort(
(await simpleGit().tags([`--contains=${commit.hash}`])).all
)[0]!;
const currentCommitStack = parsedCommitStacks.find(
(commitStack) => commitStack.version === tag
) || {