Skip to content

Commit 369437e

Browse files
committed
[build] Simplify installer locator script
1 parent bbd993b commit 369437e

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

build-tools/automation/yaml-templates/apk-instrumentation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ steps:
2424
testResultsFiles: ${{ parameters.testResultsFiles }}
2525
failTaskOnFailedTests: true
2626
testRunTitle: ${{ parameters.testName }}
27-
condition: succeededOrFailed()
27+
condition: succeededOrFailed()

build-tools/automation/yaml-templates/run-installer.yaml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,15 @@ parameters:
33

44
steps:
55
- powershell: |
6-
$artifactDir = [System.IO.Path]::Combine(${{ parameters.artifactDirectory }}, "*")
7-
8-
if ([Environment]::OSVersion.Platform -eq "Unix")
9-
{
10-
$installer = Get-ChildItem -Path $artifactDir -Include *.pkg -File
11-
if (![System.IO.File]::Exists($installer)) {
12-
throw [System.IO.FileNotFoundException] "$installer not found."
13-
}
14-
Write-Host "##vso[task.setvariable variable=XA.Provisionator.Args]$installer"
15-
}
16-
else
17-
{
18-
$installer = Get-ChildItem -Path $artifactDir -Include *.vsix -File
19-
if (![System.IO.File]::Exists($installer)) {
20-
throw [System.IO.FileNotFoundException] "$installer not found."
21-
}
22-
Write-Host "##vso[task.setvariable variable=XA.Provisionator.Args]$installer"
23-
}
6+
if ([Environment]::OSVersion.Platform -eq "Unix") {
7+
$installer = Get-ChildItem -Path "${{ parameters.artifactDirectory }}/*" -Include *.pkg -File
8+
} else {
9+
$installer = Get-ChildItem -Path "${{ parameters.artifactDirectory }}\*" -Include *.vsix -File
10+
}
11+
if (![System.IO.File]::Exists($installer)) {
12+
throw [System.IO.FileNotFoundException] "Installer not found in $artifactDirectory."
13+
}
14+
Write-Host "##vso[task.setvariable variable=XA.Provisionator.Args]$installer"
2415
displayName: find installer and set provisionator variable
2516

2617
- task: provisionator@2

0 commit comments

Comments
 (0)