From b2f3a43d195073d19a88f0856184d0c37278606b Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sun, 27 Aug 2023 10:25:56 +0200 Subject: [PATCH] fix(project): exclude powershell script analyzer settings file resolves #4188 --- src/segments/project.go | 3 ++- website/docs/segments/project.mdx | 36 +++++++++++++++++-------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/segments/project.go b/src/segments/project.go index c8241fba..ade64f50 100644 --- a/src/segments/project.go +++ b/src/segments/project.go @@ -237,8 +237,9 @@ func (n *Project) getPowerShellModuleData(_ ProjectItem) *ProjectData { files := n.env.LsDir(n.env.Pwd()) var content string // get the first match only + // excluding PSScriptAnalyzerSettings.psd1 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()) break } diff --git a/website/docs/segments/project.mdx b/website/docs/segments/project.mdx index f1980234..1c62cb9b 100644 --- a/website/docs/segments/project.mdx +++ b/website/docs/segments/project.mdx @@ -17,19 +17,23 @@ Supports: - Any nuspec based project (`*.nuspec`, first file match info is displayed) - .NET project (`*.csproj`, `*.vbproj` or `*.fsproj`, first file match info is displayed) - Julia project (`JuliaProject.toml`, `Project.toml`) +- PowerShell project (`*.psd1`, first file match info is displayed) ## Sample Configuration -import Config from '@site/src/components/Config.js'; +import Config from "@site/src/components/Config.js"; - + ## Properties @@ -49,12 +53,12 @@ import Config from '@site/src/components/Config.js'; ### Properties -| Name | Type | Description | -| ---------- | -------- | ------------------------------------------------------------------------------------- | -| `.Type` | `string` | The type of project (`node`, `cargo`, `poetry`, `php`, `nuspec`, `dotnet` or `julia`) | -| `.Version` | `string` | The version of your project | -| `.Target` | `string` | The target framwork/language version of your project | -| `.Name` | `string` | The name of your project | -| `.Error` | `string` | The error context when we can't fetch the project info | +| Name | Type | Description | +| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `.Type` | `string` | The type of project:
  • `node`
  • `cargo`
  • `poetry`
  • `php`
  • `nuspec`
  • `dotnet`
  • `julia`
  • `powershell`
| +| `.Version` | `string` | The version of your project | +| `.Target` | `string` | The target framwork/language version of your project | +| `.Name` | `string` | The name of your project | +| `.Error` | `string` | The error context when we can't fetch the project info | [templates]: /docs/configuration/templates