mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 04:19:41 -08:00
fix(project): exclude powershell script analyzer settings file
resolves #4188
This commit is contained in:
parent
b5bde55cf2
commit
b2f3a43d19
|
@ -237,8 +237,9 @@ func (n *Project) getPowerShellModuleData(_ ProjectItem) *ProjectData {
|
||||||
files := n.env.LsDir(n.env.Pwd())
|
files := n.env.LsDir(n.env.Pwd())
|
||||||
var content string
|
var content string
|
||||||
// get the first match only
|
// get the first match only
|
||||||
|
// excluding PSScriptAnalyzerSettings.psd1
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
if filepath.Ext(file.Name()) == ".psd1" {
|
if filepath.Ext(file.Name()) == ".psd1" && file.Name() != "PSScriptAnalyzerSettings.psd1" {
|
||||||
content = n.env.FileContent(file.Name())
|
content = n.env.FileContent(file.Name())
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,19 +17,23 @@ Supports:
|
||||||
- Any nuspec based project (`*.nuspec`, first file match info is displayed)
|
- Any nuspec based project (`*.nuspec`, first file match info is displayed)
|
||||||
- .NET project (`*.csproj`, `*.vbproj` or `*.fsproj`, first file match info is displayed)
|
- .NET project (`*.csproj`, `*.vbproj` or `*.fsproj`, first file match info is displayed)
|
||||||
- Julia project (`JuliaProject.toml`, `Project.toml`)
|
- Julia project (`JuliaProject.toml`, `Project.toml`)
|
||||||
|
- PowerShell project (`*.psd1`, first file match info is displayed)
|
||||||
|
|
||||||
## Sample Configuration
|
## Sample Configuration
|
||||||
|
|
||||||
import Config from '@site/src/components/Config.js';
|
import Config from "@site/src/components/Config.js";
|
||||||
|
|
||||||
<Config data={{
|
<Config
|
||||||
"type": "project",
|
data={{
|
||||||
"style": "powerline",
|
type: "project",
|
||||||
"powerline_symbol": "\uE0B0",
|
style: "powerline",
|
||||||
"foreground": "#193549",
|
powerline_symbol: "\uE0B0",
|
||||||
"background": "#ffeb3b",
|
foreground: "#193549",
|
||||||
"template": " {{ if .Error }}{{ .Error }}{{ else }}{{ if .Version }}\uf487 {{.Version}}{{ end }} {{ if .Name }}{{ .Name }}{{ end }}{{ end }} "
|
background: "#ffeb3b",
|
||||||
}}/>
|
template:
|
||||||
|
" {{ if .Error }}{{ .Error }}{{ else }}{{ if .Version }}\uf487 {{.Version}}{{ end }} {{ if .Name }}{{ .Name }}{{ end }}{{ end }} ",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
|
@ -49,12 +53,12 @@ import Config from '@site/src/components/Config.js';
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
| ---------- | -------- | ------------------------------------------------------------------------------------- |
|
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `.Type` | `string` | The type of project (`node`, `cargo`, `poetry`, `php`, `nuspec`, `dotnet` or `julia`) |
|
| `.Type` | `string` | The type of project:<ul><li>`node`</li><li>`cargo`</li><li>`poetry`</li><li>`php`</li><li>`nuspec`</li><li>`dotnet`</li><li>`julia`</li><li>`powershell`</li></ul> |
|
||||||
| `.Version` | `string` | The version of your project |
|
| `.Version` | `string` | The version of your project |
|
||||||
| `.Target` | `string` | The target framwork/language version of your project |
|
| `.Target` | `string` | The target framwork/language version of your project |
|
||||||
| `.Name` | `string` | The name of your project |
|
| `.Name` | `string` | The name of your project |
|
||||||
| `.Error` | `string` | The error context when we can't fetch the project info |
|
| `.Error` | `string` | The error context when we can't fetch the project info |
|
||||||
|
|
||||||
[templates]: /docs/configuration/templates
|
[templates]: /docs/configuration/templates
|
||||||
|
|
Loading…
Reference in a new issue