Skip to content

Commit

Permalink
feat: PipeScript.Languages.Exclude ( Fixes #875, Fixes #876, Fixes #877
Browse files Browse the repository at this point in the history
… )
  • Loading branch information
StartAutomating authored and StartAutomating committed Jan 12, 2024
1 parent 0ca4178 commit ab8020c
Showing 1 changed file with 110 additions and 0 deletions.
110 changes: 110 additions & 0 deletions PipeScript.types.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -2620,6 +2620,18 @@ foreach ($potentialTemplatePath in $potentialTemplatePaths ) {
<Type>
<Name>PipeScript.Interpreters</Name>
<Members>
<AliasProperty>
<Name>ExcludePaths</Name>
<ReferencedMemberName>ExcludePaths</ReferencedMemberName>
</AliasProperty>
<AliasProperty>
<Name>ExcludePatterns</Name>
<ReferencedMemberName>ExcludePatterns</ReferencedMemberName>
</AliasProperty>
<AliasProperty>
<Name>Excludes</Name>
<ReferencedMemberName>Exclude</ReferencedMemberName>
</AliasProperty>
<AliasProperty>
<Name>LanguageNames</Name>
<ReferencedMemberName>LanguageName</ReferencedMemberName>
Expand Down Expand Up @@ -2726,6 +2738,43 @@ foreach ($prop in $this.psobject.properties) {
return $count
</SetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>Exclude</Name>
<GetScriptBlock>
&lt;#
.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.
#&gt;
param()


return @(
$this.ExcludePattern
$this.ExcludePath
)
</GetScriptBlock>
<SetScriptBlock>
&lt;#
.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.
#&gt;
param()


return @(
$this.ExcludePattern
$this.ExcludePath
)
</SetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>ExcludePath</Name>
<GetScriptBlock>
Expand Down Expand Up @@ -2886,6 +2935,18 @@ Note: Interpreters may require commands to be installed.
<Type>
<Name>PipeScript.Languages</Name>
<Members>
<AliasProperty>
<Name>ExcludePaths</Name>
<ReferencedMemberName>ExcludePaths</ReferencedMemberName>
</AliasProperty>
<AliasProperty>
<Name>ExcludePatterns</Name>
<ReferencedMemberName>ExcludePatterns</ReferencedMemberName>
</AliasProperty>
<AliasProperty>
<Name>Excludes</Name>
<ReferencedMemberName>Exclude</ReferencedMemberName>
</AliasProperty>
<AliasProperty>
<Name>LanguageNames</Name>
<ReferencedMemberName>LanguageName</ReferencedMemberName>
Expand Down Expand Up @@ -2960,6 +3021,55 @@ foreach ($prop in $this.psobject.properties) {
return $count
</GetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>Exclude</Name>
<GetScriptBlock>
&lt;#
.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.
#&gt;
param()


return @(
$this.ExcludePattern
$this.ExcludePath
)
</GetScriptBlock>
<SetScriptBlock>
&lt;#
.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`.
#&gt;
$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
}

</SetScriptBlock>
</ScriptProperty>
<ScriptProperty>
<Name>ExcludePath</Name>
<GetScriptBlock>
Expand Down

0 comments on commit ab8020c

Please sign in to comment.