mirror of
https://gitea.com/actions/setup-node.git
synced 2025-12-14 12:41:33 +08:00
minor fix
This commit is contained in:
@@ -12,6 +12,7 @@ export default class NightlyNodejs extends BaseDistribution {
|
||||
}
|
||||
|
||||
protected findVersionInHoostedToolCacheDirectory(): string {
|
||||
let toolPath = '';
|
||||
const localVersionPaths = tc
|
||||
.findAllVersions('node', this.nodeInfo.arch)
|
||||
.filter(i => {
|
||||
@@ -23,7 +24,9 @@ export default class NightlyNodejs extends BaseDistribution {
|
||||
return prerelease[0].includes('nightly');
|
||||
});
|
||||
const localVersion = this.evaluateVersions(localVersionPaths);
|
||||
const toolPath = tc.find('node', localVersion, this.nodeInfo.arch);
|
||||
if (localVersion) {
|
||||
toolPath = tc.find('node', localVersion, this.nodeInfo.arch);
|
||||
}
|
||||
|
||||
return toolPath;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ export default class CanaryBuild extends BaseDistribution {
|
||||
}
|
||||
|
||||
protected findVersionInHoostedToolCacheDirectory(): string {
|
||||
let toolPath = '';
|
||||
const localVersionPaths = tc
|
||||
.findAllVersions('node', this.nodeInfo.arch)
|
||||
.filter(i => {
|
||||
@@ -24,7 +25,9 @@ export default class CanaryBuild extends BaseDistribution {
|
||||
});
|
||||
|
||||
const localVersion = this.evaluateVersions(localVersionPaths);
|
||||
const toolPath = tc.find('node', localVersion, this.nodeInfo.arch);
|
||||
if (localVersion) {
|
||||
toolPath = tc.find('node', localVersion, this.nodeInfo.arch);
|
||||
}
|
||||
|
||||
return toolPath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user