Skip to content

Commit 8c24051

Browse files
committed
add failing powershell replacer tests part 9
1 parent d9b49f5 commit 8c24051

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,26 @@ jobs:
5050
- name: Verify older situation
5151
shell: powershell
5252
run: |
53-
Get-Command lando | Select-Object -ExpandProperty Source | Select-String -Pattern "$env:USERPROFILE\.lando\bin\lando.cmd" -SimpleMatch -ErrorAction Stop
54-
lando version | Select-String -Pattern "${{ matrix.old-version }}" -SimpleMatch -ErrorAction Stop
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
60+
}
61+
5562
- name: Replace Lando with setup-script
5663
shell: powershell
5764
run: .\setup-lando.ps1 -Version=${{ matrix.version }} -NoSetup
5865
- name: Verify new situation
5966
shell: powershell
6067
run: |
61-
Get-Command lando | Select-Object -ExpandProperty Source | Select-String -Pattern "$env:USERPROFILE\.lando\bin\lando.exe" -SimpleMatch -ErrorAction Stop
62-
lando version | Select-String -Pattern "${{ matrix.version }}" -SimpleMatch -ErrorAction Stop
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
75+
}

0 commit comments

Comments
 (0)