Skip to content

Commit 91429ff

Browse files
committed
Provide fallback Anchor version
1 parent 29d98ca commit 91429ff

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

utils/versionAnchor.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import {
77
Version,
88
} from './versionCore';
99

10+
export const FALLBACK_ANCHOR_VERSION: Version = '0.31.0';
11+
1012
export async function detectAnchorVersion(
1113
language: Language
1214
): Promise<Version> {
@@ -22,8 +24,8 @@ export async function detectAnchorVersion(
2224
export function resolveAnchorVersion(
2325
detectedVersion: Version | undefined
2426
): ResolvedVersion | undefined {
25-
if (!detectedVersion) return undefined;
26-
const [full, withoutPatch] =
27-
getVersionAndVersionWithoutPatch(detectedVersion);
27+
const [full, withoutPatch] = getVersionAndVersionWithoutPatch(
28+
detectedVersion ?? FALLBACK_ANCHOR_VERSION
29+
);
2830
return { full, withoutPatch, detected: detectedVersion };
2931
}

0 commit comments

Comments
 (0)