diff --git a/dist/setup/index.js b/dist/setup/index.js index 0a98b4d..67c1d96 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -71768,13 +71768,10 @@ function translateArchToDistUrl(arch) { } } function parseNodeVersionFile(contents) { - let nodeVersion; + let nodeVersion = contents.trim(); if (contents.includes('volta')) { nodeVersion = JSON.parse(contents).volta.node; } - else { - nodeVersion = contents.trim(); - } if (/^v\d/.test(nodeVersion)) { nodeVersion = nodeVersion.substring(1); } diff --git a/src/installer.ts b/src/installer.ts index c9fd0d2..a56b20a 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -495,17 +495,16 @@ function translateArchToDistUrl(arch: string): string { } export function parseNodeVersionFile(contents: string): string { - let nodeVersion; + let nodeVersion = contents.trim(); if (contents.includes('volta')) { nodeVersion = JSON.parse(contents).volta.node; - } else { - nodeVersion = contents.trim(); } if (/^v\d/.test(nodeVersion)) { nodeVersion = nodeVersion.substring(1); } + return nodeVersion; }