-
-
Notifications
You must be signed in to change notification settings - Fork 351
/
Copy pathinstall-plugins.sh
executable file
·58 lines (53 loc) · 1.81 KB
/
install-plugins.sh
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
54
55
56
57
58
#!/bin/bash -e
#
# Usage:
# $ curl -fsSL https://raw.githubusercontent.com/pact-foundation/pact-plugins/master/install-cli.sh | bash
# or
# $ wget -q https://raw.githubusercontent.com/pact-foundation/pact-plugins/master/install-cli.sh -O- | bash
#
set -e # Needed for Windows bash, which doesn't read the shebang
function detect_osarch() {
case $(uname -sm) in
'Linux x86_64')
os='linux'
arch='x86_64'
;;
'Linux aarch64')
os='linux'
arch='aarch64'
;;
'Darwin x86' | 'Darwin x86_64')
os='osx'
arch='x86_64'
;;
'Darwin arm64')
os='osx'
arch='aarch64'
;;
CYGWIN*|MINGW32*|MSYS*|MINGW*)
os="windows"
arch='x86_64'
ext='.exe'
;;
*)
echo "Sorry, you'll need to install the plugin CLI manually."
exit 1
;;
esac
}
VERSION="0.0.4"
detect_osarch
if [ ! -f ~/.pact/bin/pact-plugin-cli ]; then
echo "--- 🐿 Installing plugins CLI version '${VERSION}' (from tag ${TAG})"
mkdir -p ~/.pact/bin
DOWNLOAD_LOCATION=https://github.com/pact-foundation/pact-plugins/releases/download/pact-plugin-cli-v${VERSION}/pact-plugin-cli-${os}-${arch}${ext}.gz
echo " Downloading from: ${DOWNLOAD_LOCATION}"
curl -L -o ~/.pact/bin/pact-plugin-cli-${os}-${arch}.gz "${DOWNLOAD_LOCATION}"
echo " Downloaded $(file ~/.pact/bin/pact-plugin-cli-${os}-${arch}.gz)"
gunzip -N -f ~/.pact/bin/pact-plugin-cli-${os}-${arch}.gz
chmod +x ~/.pact/bin/pact-plugin-cli
fi
if [ ! -d ~/.pact/plugins/matt-0.1.0 ]; then
echo "--- 🐿 Installing MATT plugin"
~/.pact/bin/pact-plugin-cli install https://github.com/you54f/pact-matt-plugin/releases/tag/v0.1.0
fi