Skip to content

Commit

Permalink
Request during review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dsame committed Nov 11, 2022
1 parent de40daa commit 76ab357
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as tc from '@actions/tool-cache';
import * as path from 'path';
import * as semver from 'semver';
import fs = require('fs');
import {compare} from 'semver';

//
// Node versions interface
Expand Down Expand Up @@ -355,19 +356,13 @@ async function resolveVersionFromManifest(
}
}

// TODO - should we just export this from @actions/tool-cache? Lifted directly from there
export function evaluateVersions(
versions: string[],
versionSpec: string
): string {
let version = '';
core.debug(`evaluating ${versions.length} versions`);
versions = versions.sort((a, b) => {
if (semver.gt(a, b)) {
return 1;
}
return -1;
});
versions = versions.sort(compare);

const matcher: (potential: string) => boolean = isVersionCanary(versionSpec)
? evaluateCanaryMatcher(versionSpec)
Expand Down

0 comments on commit 76ab357

Please sign in to comment.