Skip to content

Commit 407ba42

Browse files
committed
Improve function Add-GitHubActionsProblemMatcher efficiency
1 parent 82bc9e7 commit 407ba42

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

hugoalh.GitHubActionsToolkit/hugoalh.GitHubActionsToolkit.psm1

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,8 @@ function Add-GitHubActionsProblemMatcher {
202202
process {
203203
switch ($PSCmdlet.ParameterSetName) {
204204
'path' {
205-
$Path | ForEach-Object -Process {
206-
return ([string[]](Resolve-Path -Path $_ -Relative) | Where-Object -FilterScript {
207-
return ($null -ne $_ -and $_.Length -gt 0)
208-
} | ForEach-Object -Process {
209-
return Write-GitHubActionsCommand -Command 'add-matcher' -Message ($_ -replace '^\.[\\\/]', '' -replace '\\', '/')
210-
})
205+
[string[]](Resolve-Path -Path $Path -Relative) | ForEach-Object -Process {
206+
return Write-GitHubActionsCommand -Command 'add-matcher' -Message ($_ -replace '^\.[\\\/]', '' -replace '\\', '/')
211207
}
212208
break
213209
}

0 commit comments

Comments
 (0)