Skip to content

Commit

Permalink
Effekt versions should be compared loosely
Browse files Browse the repository at this point in the history
  • Loading branch information
jiribenes committed Aug 10, 2024
1 parent 8d1abde commit 9f2a545
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/effektManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ export class EffektManager {
const currentVersion = await this.execCommand(`"${effektPath}" --version`);
const latestVersion = await this.getLatestNPMVersion(this.effektNPMPackage);

if (semver.gt(latestVersion, semver.clean(currentVersion) || '')) {
// check if the latest version strictly newer than the current version
if (semver.gt(latestVersion, semver.clean(currentVersion, true) || '', true)) {
return this.promptForAction(latestVersion, 'update');
}

Expand Down
6 changes: 3 additions & 3 deletions src/semver.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module 'semver' {
export function gt(v1: string, v2: string): boolean;
export function lt(v1: string, v2: string): boolean;
export function clean(v: string): string | null;
export function gt(v1: string, v2: string, loose?: boolean): boolean;
export function lt(v1: string, v2: string, loose?: boolean): boolean;
export function clean(v: string, loose?: boolean): string | null;
}

0 comments on commit 9f2a545

Please sign in to comment.