Skip to content

Commit 44aada4

Browse files
author
Alberto Iannaccone
committed
fix how the old changelog is cut off
1 parent 4713ba7 commit 44aada4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

arduino-ide-extension/src/electron-main/ide-updater/ide-updater-impl.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ export class IDEUpdaterImpl implements IDEUpdater {
6464
} = await this.updater.checkForUpdates();
6565

6666
this.cancellationToken = cancellationToken;
67-
if (this.updater.currentVersion.compare(updateInfo.version) === -1) {
67+
if (
68+
this.updater.currentVersion.compare(updateInfo.version) === -1 ||
69+
true
70+
) {
6871
/*
6972
'latest.txt' points to the latest changelog that has been generated by the CI,
7073
so we need to make a first GET request to get the filename of the changelog
@@ -81,11 +84,9 @@ export class IDEUpdaterImpl implements IDEUpdater {
8184
? await fetch(`${CHANGELOG_BASE_URL}/${latestChangelogFileName}`)
8285
: null;
8386
const changelog = response?.ok ? await response?.text() : null;
84-
87+
const currentVersionHeader = `\n\n---\n\n## ${this.updater.currentVersion}\n\n`;
8588
// We only want to see the release notes of newer versions
86-
const currentVersionIndex = changelog?.indexOf(
87-
`\r\n\r\n---\r\n\r\n## ${this.updater.currentVersion}\r\n\r\n`
88-
);
89+
const currentVersionIndex = changelog?.indexOf(currentVersionHeader);
8990
const newChangelog =
9091
currentVersionIndex && currentVersionIndex > 0
9192
? changelog?.slice(0, currentVersionIndex)

0 commit comments

Comments
 (0)