diff --git a/BuildPromptFromFiles.psd1 b/BuildPromptFromFiles.psd1 index e9d1c83..ed80f65 100644 --- a/BuildPromptFromFiles.psd1 +++ b/BuildPromptFromFiles.psd1 @@ -5,7 +5,7 @@ RootModule = 'BuildPromptFromFiles.psm1' # Version number of this module. - ModuleVersion = '0.2.1' + ModuleVersion = '0.2.2' # ID used to uniquely identify this module GUID = 'fa761a01-55b9-436d-8928-9dfd0ffdf978' diff --git a/Public/Build-PromptFromFiles.ps1 b/Public/Build-PromptFromFiles.ps1 index 0f297dc..da58018 100644 --- a/Public/Build-PromptFromFiles.ps1 +++ b/Public/Build-PromptFromFiles.ps1 @@ -10,6 +10,9 @@ The output can be in raw format or XML format. .PARAMETER Path An array of directory paths to scan. Defaults to the current directory. +.PARAMETER ignoreFolders +An array of folder patterns to ignore. + .PARAMETER ignore An array of file patterns to ignore. Additional patterns are added by default. @@ -28,12 +31,16 @@ This example scans the "C:\Projects" directory, includes patterns from .gitignor Build-PromptFromFiles -Path "C:\Projects", "D:\Work" -ignore "*.log" This example scans the "C:\Projects" and "D:\Work" directories, ignores .log files, and outputs the content in XML format. + +.EXAMPLE +Build-PromptFromFiles -Path "C:\Projects" -ignoreFolders "bin", "obj" #> function Build-PromptFromFiles { [CmdletBinding()] param ( [string[]]$Path = $pwd, [string[]]$ignore, + [string[]]$ignoreFolders, [Switch]$gitIgnore, [Switch]$Raw ) @@ -51,7 +58,9 @@ function Build-PromptFromFiles { $ignore += (Get-GitIgnoreContent -Path $targetPath) } - (Get-ChildItem -Path $targetPath -Recurse -File -Exclude $ignore).FullName | Sort-Object + $filteredTargetPath = Get-ChildItem -Path $targetPath -Exclude $ignoreFolders + + (Get-ChildItem -Path $filteredTargetPath -Recurse -File -Exclude $ignore).FullName | Sort-Object } $outputText = [System.Text.StringBuilder]::new() diff --git a/changelog.md b/changelog.md index d5529c4..2eabec3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,7 @@ +# v0.2.2 + +- Thank you to @Agazoth for add the `-ignoreFolders` 👍🏼 + # v0.2.1 - Added `Build-PromptFromGitHubRepo`