Skip to content

Commit c231be8

Browse files
committed
use ternary operator with pwsh 7
Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
1 parent 3a77786 commit c231be8

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

action.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ runs:
7474
$vol = '${{ inputs.work-vol }}'
7575
# If temporary drive D: doesn't exist in the VM, fallback to C:
7676
if ("$vol" -eq '') {
77-
if (Test-Path -LiteralPath 'D:\') {
78-
$vol = 'D:'
79-
} else {
80-
$vol = 'C:'
81-
}
77+
$vol = (Test-Path -LiteralPath 'D:\') ? 'D:' : 'C:'
8278
}
8379
8480
$setupExe = "$vol\setup.exe"
@@ -150,10 +146,7 @@ runs:
150146
}
151147
}
152148
153-
$installDir = "$vol\cygwin"
154-
if ('${{ inputs.install-dir }}' -ne '') {
155-
$installDir = '${{ inputs.install-dir }}'
156-
}
149+
$installDir = '${{ inputs.install-dir }}' -ne '' ? '${{ inputs.install-dir }}' : "$vol\cygwin"
157150
158151
$packageDir = "$vol\cygwin-packages"
159152

0 commit comments

Comments
 (0)