Skip to content

Commit

Permalink
fix: parse corrected latest version from Unity registry (close #156)
Browse files Browse the repository at this point in the history
  • Loading branch information
favoyang committed Mar 6, 2024
1 parent d2cfb75 commit 62aaf2b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/packument-resolving.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { VersionReference } from "./types/package-reference";
import { NpmClient, Registry } from "./registry-client";
import { DomainName } from "./types/domain-name";
import { SemanticVersion } from "./types/semantic-version";
import { UnityPackument, UnityPackumentVersion } from "./types/packument";
import {
tryGetLatestVersion,
UnityPackument,
UnityPackumentVersion,
} from "./types/packument";
import { recordKeys } from "./utils/record-utils";
import { PackageUrl } from "./types/package-url";
import { PackumentCache, tryGetFromCache } from "./packument-cache";
Expand Down Expand Up @@ -105,7 +109,8 @@ export function tryResolveFromPackument(

// Find the latest version
if (requestedVersion === undefined || requestedVersion === "latest") {
const latestVersion = availableVersions.at(-1)!;
let latestVersion = tryGetLatestVersion(packument);
if (latestVersion === undefined) latestVersion = availableVersions.at(-1)!;
return {
isSuccess: true,
packument,
Expand Down

0 comments on commit 62aaf2b

Please sign in to comment.