mirror of
https://github.com/actions/setup-node.git
synced 2024-11-13 18:58:04 +00:00
chore: trim no matter what
This commit is contained in:
parent
d86a20eb78
commit
1c48dc5a9e
5
dist/setup/index.js
vendored
5
dist/setup/index.js
vendored
@ -71768,13 +71768,10 @@ function translateArchToDistUrl(arch) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function parseNodeVersionFile(contents) {
|
function parseNodeVersionFile(contents) {
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user