Skip to content

Parse only first line of nvmrc#432

Open
skewwhiffy wants to merge 1 commit intoasdf-vm:masterfrom
skewwhiffy:support-nvmrc-with-comments
Open

Parse only first line of nvmrc#432
skewwhiffy wants to merge 1 commit intoasdf-vm:masterfrom
skewwhiffy:support-nvmrc-with-comments

Conversation

@skewwhiffy
Copy link

#397

As described here, the .nvmrc file's first line is the one that contains the version number required. This PR replaces the command to read the whole file into the version parser with a command to read just the first line.

Copy link
Member

@augustobmoura augustobmoura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, got tangled in a few personnal problems

source "$(dirname "$0")/../lib/utils.sh"

resolve_version "$(cat "$1")"
resolve_version "$(head -n 1 "$1")"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make sure this only apply to .nvmrc? It shouldn't apply for other legacy version files (.node-version for now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants