powerline-shell icon indicating copy to clipboard operation
powerline-shell copied to clipboard

Add option to require package.json for node_version segment

Open maxrzaw opened this issue 2 years ago • 0 comments

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 avatar Jan 07 '23 04:01 maxrzaw