Skip to content

Commit 5634cb7

Browse files
committed
Convert 'evaluate' to function ref syntax
1 parent dd344c0 commit 5634cb7

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

utils/actions/Invoke-LocalAction.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $localActions['add-diagnostic'] = ${function:Invoke-AddDiagnosticLocalAction}
2020
$localActions['assert-existence'] = ${function:Invoke-AssertBranchExistenceLocalAction}
2121
$localActions['assert-pushed'] = ${function:Invoke-AssertBranchPushedLocalAction}
2222
$localActions['assert-updated'] = ${function:Invoke-AssertBranchUpToDateLocalAction}
23-
Register-LocalActionEvaluate $localActions
23+
$localActions['evaluate'] = ${function:Invoke-EvaluateLocalAction}
2424
$localActions['filter-branches'] = ${function:Invoke-FilterBranchesLocalAction}
2525
$localActions['get-all-upstreams'] = ${function:Invoke-GetAllUpstreamsLocalAction}
2626
$localActions['get-downstream'] = ${function:Invoke-GetDownstreamLocalAction}

utils/actions/local/Register-LocalActionEvaluate.psm1

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ Import-Module -Scope Local "$PSScriptRoot/../../core.psm1"
22
Import-Module -Scope Local "$PSScriptRoot/../../framework.psm1"
33
Import-Module -Scope Local "$PSScriptRoot/../../query-state.psm1"
44

5-
function Register-LocalActionEvaluate([PSObject] $localActions) {
6-
$localActions['evaluate'] = {
7-
param(
8-
[Parameter(Mandatory)][AllowNull()][object] $result,
9-
[Parameter()][AllowNull()][AllowEmptyCollection()][System.Collections.ArrayList] $diagnostics
10-
)
5+
function Invoke-EvaluateLocalAction {
6+
param(
7+
[Parameter(Mandatory)][AllowNull()][object] $result,
8+
[Parameter()][AllowNull()][AllowEmptyCollection()][System.Collections.ArrayList] $diagnostics
9+
)
1110

12-
return $result
13-
}
11+
return $result
1412
}
1513

16-
Export-ModuleMember -Function Register-LocalActionEvaluate
14+
Export-ModuleMember -Function Invoke-EvaluateLocalAction

0 commit comments

Comments
 (0)