Skip to content

Commit 0aecd56

Browse files
committed
Run 'npm run build'
1 parent c90afab commit 0aecd56

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

dist/setup/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62682,8 +62682,16 @@ function translateArchToDistUrl(arch) {
6268262682
}
6268362683
function parseNodeVersionFile(contents) {
6268462684
let nodeVersion = contents.trim();
62685-
if (/^v\d/.test(nodeVersion)) {
62686-
nodeVersion = nodeVersion.substring(1);
62685+
try {
62686+
// assume all content parseable as JSON is a valid,
62687+
// npm package.json file
62688+
nodeVersion = JSON.parse(nodeVersion).engines.node;
62689+
}
62690+
catch (err) {
62691+
// if not, assume it is a node version file
62692+
if (/^v\d/.test(nodeVersion)) {
62693+
nodeVersion = nodeVersion.substring(1);
62694+
}
6268762695
}
6268862696
return nodeVersion;
6268962697
}

0 commit comments

Comments
 (0)