Skip to content

Commit

Permalink
refactor(cli): remove try-catch on comareCommits
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Aug 2, 2024
1 parent 4f4ced4 commit 94b3ec0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 4 additions & 0 deletions cli/main_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ describe("CLI", () => {
);
});

it("should not throw with `--changelog`", async () => {
await molt("--changelog");
});

it("should update `deno.json` with `--write`", async () => {
const { stderr, stdout } = await molt("--write");
assertEquals(
Expand Down
8 changes: 1 addition & 7 deletions cli/src/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@ export async function printChangelog(
// The dependency was newly added in this update
return;
}
const messages: string[] = [];
try {
// The refs might not exist
messages.push(...await compareCommits(repo, oldest, to));
} catch {
return;
}
const messages = await compareCommits(repo, oldest, to);
const root = await resolvePackageRoot(repo, pkg, to);
if (!root) {
// The package seems to be generated dynamically on publish
Expand Down

0 comments on commit 94b3ec0

Please sign in to comment.