add search in toolcache for canary

This commit is contained in:
Dmitry Shibanov 2022-12-13 16:27:32 +01:00
parent 9eba46a481
commit 05e1c35e88
3 changed files with 53 additions and 2 deletions

View file

@ -12,7 +12,16 @@ export default class NightlyNodejs extends BaseDistribution {
}
protected findVersionInHoostedToolCacheDirectory(): string {
const localVersionPaths = tc.findAllVersions('node', this.nodeInfo.arch);
const localVersionPaths = tc
.findAllVersions('node', this.nodeInfo.arch)
.filter(i => {
const prerelease = semver.prerelease(i);
if (!prerelease) {
return false;
}
return prerelease[0].includes('nightly');
});
const localVersion = this.evaluateVersions(localVersionPaths);
const toolPath = tc.find('node', localVersion, this.nodeInfo.arch);