Skip to content

Commit dfb9298

Browse files
committed
add failing powershell replacer tests part 10
1 parent 8c24051 commit dfb9298

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

.github/workflows/pr-windows-script-replacer-tests.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@ jobs:
5050
- name: Verify older situation
5151
shell: powershell
5252
run: |
53-
$ErrorActionPreference = "Stop"
54-
try {
55-
Get-Command lando | Select-Object -ExpandProperty Source | Select-String -Pattern "$env:USERPROFILE\.lando\bin\lando.cmd" -SimpleMatch
56-
lando version | Select-String -Pattern "${{ matrix.old-version }}" -SimpleMatch
57-
} catch {
58-
Write-Error "Error: Pattern not found."
59-
exit 1
53+
if (-not (Get-Command lando | Select-Object -ExpandProperty Source | Select-String -Pattern "$env:USERPROFILE\.lando\bin\lando.cmd" -SimpleMatch)) {
54+
throw "Error: lando is not where we expect it!"
55+
}
56+
57+
if (-not (lando version | Select-String -Pattern "${{ matrix.old-version }}" -SimpleMatch)) {
58+
throw "Error: lando is not the version we expect!"
6059
}
6160
6261
- name: Replace Lando with setup-script
@@ -65,11 +64,10 @@ jobs:
6564
- name: Verify new situation
6665
shell: powershell
6766
run: |
68-
$ErrorActionPreference = "Stop"
69-
try {
70-
Get-Command lando | Select-Object -ExpandProperty Source | Select-String -Pattern "$env:USERPROFILE\.lando\bin\lando.exe" -SimpleMatch -ErrorAction Stop
71-
lando version | Select-String -Pattern "${{ matrix.version }}" -SimpleMatch -ErrorAction Stop
72-
} catch {
73-
Write-Error "Error: Pattern not found."
74-
exit 1
67+
if (-not (Get-Command lando | Select-Object -ExpandProperty Source | Select-String -Pattern "$env:USERPROFILE\.lando\bin\lando.exe" -SimpleMatch)) {
68+
throw "Error: lando is not where we expect it!"
69+
}
70+
71+
if (-not (lando version | Select-String -Pattern "${{ matrix.version }}" -SimpleMatch)) {
72+
throw "Error: lando is not the version we expect!"
7573
}

0 commit comments

Comments
 (0)