|
|
@ -495,17 +495,16 @@ function translateArchToDistUrl(arch: string): string {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function parseNodeVersionFile(contents: string): string {
|
|
|
|
export function parseNodeVersionFile(contents: string): string {
|
|
|
|
let nodeVersion;
|
|
|
|
let nodeVersion = contents.trim();
|
|
|
|
|
|
|
|
|
|
|
|
if (contents.includes('volta')) {
|
|
|
|
if (contents.includes('volta')) {
|
|
|
|
nodeVersion = JSON.parse(contents).volta.node;
|
|
|
|
nodeVersion = JSON.parse(contents).volta.node;
|
|
|
|
} else {
|
|
|
|
|
|
|
|
nodeVersion = contents.trim();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (/^v\d/.test(nodeVersion)) {
|
|
|
|
if (/^v\d/.test(nodeVersion)) {
|
|
|
|
nodeVersion = nodeVersion.substring(1);
|
|
|
|
nodeVersion = nodeVersion.substring(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return nodeVersion;
|
|
|
|
return nodeVersion;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|