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

Add option to require package.json for node_version segment #539

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

maxrzaw
Copy link

@maxrzaw maxrzaw commented Jan 7, 2023

I added some features to the node_version segment to make it more configurable and fit my needs better.

Configuration Variables

If "requires_package" is set to true, then the segment will not add the segment if it does not find a "package.json" file in the path to the root.
I also added "chars" which is the number of characters of the output of node --version to display.

Example Configuration:

{
  "segments": [
    "node_version"
  ],
  "node_version": {
      "require_package": true,
      "chars": 3
  }
}

Default

image

With "chars": 3

image

Note: these screenshots are before I made a change to add a space at the end of the segment.

@maxrzaw maxrzaw marked this pull request as ready for review January 7, 2023 04:36
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.

None yet

1 participant