-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·53 lines (45 loc) · 1.99 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·53 lines (45 loc) · 1.99 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
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh -e
## Deprecation shim — delegates to the cargo-dist-generated installer.
##
## DEPRECATED: will be removed after 2027-01-01.
## Use the new installer instead:
##
## curl --proto '=https' --tlsv1.2 -LsSf \
## https://github.com/pact-foundation/pact-cli/releases/latest/download/pact-installer.sh | sh
##
## To install a specific version:
## curl --proto '=https' --tlsv1.2 -LsSf \
## https://github.com/pact-foundation/pact-cli/releases/download/<VERSION>/pact-installer.sh | sh
cat >&2 <<EOF
DEPRECATION NOTICE
This install script is deprecated and will stop working after 2027-01-01.
Use the new installer instead:
curl --proto '=https' --tlsv1.2 -LsSf \
https://github.com/pact-foundation/pact-cli/releases/latest/download/pact-installer.sh | sh
EOF
if [ -z "$PACT_CLI_VERSION" ] || [ "$PACT_CLI_VERSION" = "vlatest" ]; then
installer_url="https://github.com/pact-foundation/pact-cli/releases/latest/download/pact-installer.sh"
else
installer_url="https://github.com/pact-foundation/pact-cli/releases/download/${PACT_CLI_VERSION}/pact-installer.sh"
fi
tmpfile=$(mktemp /tmp/pact-installer.XXXXXX) || exit 1
trap 'rm -f "$tmpfile"' EXIT
if command -v curl >/dev/null 2>&1; then
if ! curl --proto '=https' --tlsv1.2 -LsSf --fail -o "$tmpfile" "$installer_url"; then
echo "Failed to download installer from: $installer_url" >&2
echo "Versions older than v0.8.0 do not have a cargo-dist installer." >&2
echo "Download manually from: https://github.com/pact-foundation/pact-cli/releases/tag/${PACT_CLI_VERSION:-latest}" >&2
exit 1
fi
elif command -v wget >/dev/null 2>&1; then
if ! wget -q -O "$tmpfile" "$installer_url"; then
echo "Failed to download installer from: $installer_url" >&2
echo "Versions older than v0.8.0 do not have a cargo-dist installer." >&2
echo "Download manually from: https://github.com/pact-foundation/pact-cli/releases/tag/${PACT_CLI_VERSION:-latest}" >&2
exit 1
fi
else
echo "Error: curl or wget is required to install pact." >&2
exit 1
fi
sh "$tmpfile"