From ab8020c33b32e6f60b651716907fc15e95b7d5d9 Mon Sep 17 00:00:00 2001 From: StartAutomating Date: Fri, 12 Jan 2024 00:48:33 +0000 Subject: [PATCH] feat: PipeScript.Languages.Exclude ( Fixes #875, Fixes #876, Fixes #877 ) --- PipeScript.types.ps1xml | 110 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/PipeScript.types.ps1xml b/PipeScript.types.ps1xml index 32ffeedd8..b074c0992 100644 --- a/PipeScript.types.ps1xml +++ b/PipeScript.types.ps1xml @@ -2620,6 +2620,18 @@ foreach ($potentialTemplatePath in $potentialTemplatePaths ) { PipeScript.Interpreters + + ExcludePaths + ExcludePaths + + + ExcludePatterns + ExcludePatterns + + + Excludes + Exclude + LanguageNames LanguageName @@ -2726,6 +2738,43 @@ foreach ($prop in $this.psobject.properties) { return $count + + Exclude + + <# +.SYNOPSIS + Gets Languages Exclusions +.DESCRIPTION + Gets any excluded patterns and paths for languages in PipeScript. + + If a command matches any of these patterns, it should not be interpreted. +#> +param() + + +return @( + $this.ExcludePattern + $this.ExcludePath +) + + + <# +.SYNOPSIS + Gets Languages Exclusions +.DESCRIPTION + Gets any excluded patterns and paths for languages in PipeScript. + + If a command matches any of these patterns, it should not be interpreted. +#> +param() + + +return @( + $this.ExcludePattern + $this.ExcludePath +) + + ExcludePath @@ -2886,6 +2935,18 @@ Note: Interpreters may require commands to be installed. PipeScript.Languages + + ExcludePaths + ExcludePaths + + + ExcludePatterns + ExcludePatterns + + + Excludes + Exclude + LanguageNames LanguageName @@ -2960,6 +3021,55 @@ foreach ($prop in $this.psobject.properties) { return $count + + Exclude + + <# +.SYNOPSIS + Gets Languages Exclusions +.DESCRIPTION + Gets any excluded patterns and paths for languages in PipeScript. + + If a command matches any of these patterns, it should not be interpreted. +#> +param() + + +return @( + $this.ExcludePattern + $this.ExcludePath +) + + + <# +.SYNOPSIS + Sets language exclusions +.DESCRIPTION + Gets any excluded patterns and paths for languages in PipeScript. +.NOTES + If you provide a `[regex]`, it will set `.ExcludePattern`. + Otherwise, this will set `.ExcludePath`. +#> +$unrolledArgs = $args | . { process { $_ } } +$patterns = @() +$paths = @( +foreach ($arg in $unrolledArgs) { + if ($arg -is [Regex]) { + $patterns += $arg + } else { + "$arg" + } +}) + +if ($patterns) { + $this.ExcludePattern = $patterns +} +if ($paths) { + $this.ExcludePath = $paths +} + + + ExcludePath