Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add volta as node-version-file #532

Merged
merged 21 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: trim no matter what
  • Loading branch information
jef committed Jun 30, 2022
commit 1c48dc5a9ea481b0befae42489e0be5be5a17ad2
5 changes: 1 addition & 4 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 2 additions & 3 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down