-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.ps1
More file actions
40 lines (35 loc) · 1.74 KB
/
Copy pathinstall.ps1
File metadata and controls
40 lines (35 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Deprecation shim — delegates to the cargo-dist-generated installer.
#
# DEPRECATED: will be removed after 2027-01-01.
# Use the new installer instead:
#
# powershell -ExecutionPolicy ByPass -c "irm https://github.com/pact-foundation/pact-cli/releases/latest/download/pact-installer.ps1 | iex"
#
# To install a specific version:
# powershell -ExecutionPolicy ByPass -c "irm https://github.com/pact-foundation/pact-cli/releases/download/<VERSION>/pact-installer.ps1 | iex"
Write-Warning @"
DEPRECATION NOTICE
This install script is deprecated and will stop working following 2027-01-01.
Use the new installer instead:
powershell -ExecutionPolicy ByPass -c ``"irm https://github.com/pact-foundation/pact-cli/releases/latest/download/pact-installer.ps1 | iex``"
"@
$version = $env:PACT_CLI_VERSION
if ([string]::IsNullOrEmpty($version) -or $version -eq "vlatest") {
$installerUrl = "https://github.com/pact-foundation/pact-cli/releases/latest/download/pact-installer.ps1"
} else {
$installerUrl = "https://github.com/pact-foundation/pact-cli/releases/download/$version/pact-installer.ps1"
}
try {
$installerScript = Invoke-RestMethod -Uri $installerUrl -ErrorAction Stop
Invoke-Expression $installerScript
} catch {
if ($_.Exception.Response -ne $null -and $_.Exception.Response.StatusCode -eq 404) {
Write-Error "Failed to download installer from: $installerUrl"
Write-Error "Versions older than v0.8.0 do not have a cargo-dist installer."
$versionTag = if ([string]::IsNullOrEmpty($version)) { 'latest' } else { $version }
Write-Error "Download manually from: https://github.com/pact-foundation/pact-cli/releases/tag/$versionTag"
} else {
Write-Error "Failed to download installer: $_"
}
exit 1
}