Skip to content

Commit 9ac42ce

Browse files
committed
use ternary operator with pwsh 7
Signed-off-by: Glenn Strauss <[email protected]>
1 parent dae423e commit 9ac42ce

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Diff for: action.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ runs:
5959
$vol = '${{ inputs.work-vol }}'
6060
# If temporary drive D: doesn't exist in the VM, fallback to C:
6161
if ("$vol" -eq '') {
62-
if (Test-Path -LiteralPath 'D:\') {
63-
$vol = 'D:'
64-
} else {
65-
$vol = 'C:'
66-
}
62+
$vol = (Test-Path -LiteralPath 'D:\') ? 'D:' : 'C:'
6763
}
6864
6965
$setupExe = "$vol\setup.exe"
@@ -94,10 +90,7 @@ runs:
9490
}
9591
}
9692
97-
$installDir = "$vol\cygwin"
98-
if ('${{ inputs.install-dir }}' -ne '') {
99-
$installDir = '${{ inputs.install-dir }}'
100-
}
93+
$installDir = '${{ inputs.install-dir }}' -ne '' ? '${{ inputs.install-dir }}' : "$vol\cygwin"
10194
10295
$args = @(
10396
'-qnO',

0 commit comments

Comments
 (0)