Skip to content

Commit

Permalink
embed catalog with cmake v3.26.1 into index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lukka committed Mar 28, 2023
1 parent 64622c4 commit 359fbae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/get-cmake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class ToolsGetter {
}

private static matchRange(theCatalog: shared.CatalogType, range: string, toolName: string): string {
core.debug(`matchRange(${theCatalog}, ${range}, ${toolName})<<`);
const targetArchPlat = shared.getArchitecturePlatform();
try {
const packages = theCatalog[range];
Expand All @@ -92,7 +93,8 @@ export class ToolsGetter {
throw Error(`Cannot find '${toolName}' version '${range}' in the catalog for the '${targetArchPlat}' platform.`);
// return 'range' itself, this is the case where it is a well defined version.
return range;
} catch {
} catch (error: any) {
core.debug(error?.message);
// Try to use the range to find the version ...
core.debug(`Collecting semvers list... `);
const matches: SemVer[] = [];
Expand All @@ -107,6 +109,7 @@ export class ToolsGetter {
if (!match || !match.version) {
throw new Error(`Cannot match '${range}' with any version in the catalog for '${toolName}'.`);
}
core.debug(`matchRange(${theCatalog}, ${range}, ${toolName})>>`);
return match.version;
}
}
Expand Down

0 comments on commit 359fbae

Please sign in to comment.