From 5502acb5853c96a2512c3697dba989086e648135 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sat, 13 Aug 2022 13:34:46 +0200 Subject: [PATCH] feat(nx): show segment on nx.json presence --- src/segments/nx.go | 2 +- website/docs/segments/nx.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/segments/nx.go b/src/segments/nx.go index 5ea84b56..f37bbf94 100644 --- a/src/segments/nx.go +++ b/src/segments/nx.go @@ -20,7 +20,7 @@ func (a *Nx) Init(props properties.Properties, env environment.Environment) { a.language = language{ env: env, props: props, - extensions: []string{"workspace.json"}, + extensions: []string{"workspace.json", "nx.json"}, commands: []*cmd{ { regex: `(?:(?P((?P[0-9]+).(?P[0-9]+).(?P[0-9]+))))`, diff --git a/website/docs/segments/nx.mdx b/website/docs/segments/nx.mdx index 1ba30f7b..3f189344 100644 --- a/website/docs/segments/nx.mdx +++ b/website/docs/segments/nx.mdx @@ -27,7 +27,7 @@ Display the currently active [Nx][nx-docs] version. - fetch_version: `boolean` - fetch the active version or not; useful if all you need is an icon indicating `ng` - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - - `files`: the segment is only displayed when `workspace.json` file is present (default) + - `files`: the segment is only displayed when a `workspace.json` or `nx.json` file is present (default) - version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes