feat(dotnet): Configure when module is shown (#2327)

This makes it possible to configure when the dotnet module is shown
based on the contents of a directory. This should make it possible to be
a lot more granular when configuring the module.
This commit is contained in:
Thomas O'Donnell
2021-02-20 15:38:03 +01:00
committed by GitHub
parent 5e93160456
commit d52edaa661
3 changed files with 56 additions and 54 deletions
+12 -9
View File
@@ -762,8 +762,8 @@ The `dotnet` module shows the relevant version of the .NET Core SDK for the curr
the SDK has been pinned in the current directory, the pinned version is shown. Otherwise the module
shows the latest installed version of the SDK.
This module will only be shown in your prompt when one or more of the following files are present in the
current directory:
By default this module will only be shown in your prompt when one or more of
the following files are present in the current directory:
- `global.json`
- `project.json`
@@ -788,13 +788,16 @@ when there is a csproj file in the current directory.
### Options
| Option | Default | Description |
| ----------- | ----------------------------------------- | -------------------------------------------------------- |
| `format` | `"[$symbol($version )(🎯 $tfm )]($style)"` | The format for the module. |
| `symbol` | `"•NET "` | The symbol used before displaying the version of dotnet. |
| `heuristic` | `true` | Use faster version detection to keep starship snappy. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `dotnet` module. |
| Option | Default | Description |
| ------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| `format` | `"[$symbol($version )(🎯 $tfm )]($style)"` | The format for the module. |
| `symbol` | `"•NET "` | The symbol used before displaying the version of dotnet. |
| `heuristic` | `true` | Use faster version detection to keep starship snappy. |
| `detect_extensions` | `["sln", "csproj", "fsproj", "xproj"]` | Which extensions should trigger this module. |
| `detect_files` | `[ "global.json", "project.json", "Directory.Build.props", "Directory.Build.targets", "Packages.props"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this modules. |
| `style` | `"bold blue"` | The style for the module. |
| `disabled` | `false` | Disables the `dotnet` module. |
### Variables