Skip to content

Conversation

matthewadams
Copy link
Contributor

Support node --version as a strategy to get the node version. Current code assumes nvm is in use.

Description

Add function node_native_version_prompt to use node --version & refactor node_version_prompt to use new envvar NODE_VERSION_STRATEGY with values nvm (default) or node to call either nvm_version_prompt or node_native_version_prompt, respectively.

Motivation and Context

Current code assumes nvm manages node. I use asdf.

How Has This Been Tested?

Tested locally.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation, I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • I have added tests to cover my changes, and all the new and existing tests pass.

@matthewadams
Copy link
Contributor Author

FYI, existing tests pass, but there are no tests for powerline's node prompt text. Just trying to get a quick & dirty done here. Default behavior is backward compatible.

@cornfeedhobo
Copy link
Member

When ever we touch stuff related to language interpreters, I like to bring up the need to support shims, which is how a lot of these version managers work now.

@matthewadams
Copy link
Contributor Author

When ever we touch stuff related to language interpreters, I like to bring up the need to support shims, which is how a lot of these version managers work now.

What does this mean with respect to this PR?

Copy link
Member

@NoahGorny NoahGorny left a comment

Choose a reason for hiding this comment

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

Hi @matthewadams, thanks for your contribution!
I left a comment, but I am looking forward to merge this :)

Copy link
Contributor

@seefood seefood left a comment

Choose a reason for hiding this comment

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

seems simple enough...

@seefood seefood merged commit 60eb7bf into Bash-it:master Nov 7, 2024
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.

4 participants