fix(commands): incorrect changelog version generation
This commit is contained in:
@@ -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
|
||||
) || {
|
||||
|
||||
Reference in New Issue
Block a user