File tree 2 files changed +35
-20
lines changed 2 files changed +35
-20
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ HOVERFLY_VERSION=$( curl -s https://api.github.com/repos/spectolabs/hoverfly/releases/latest | grep tag_name | sed -n ' s/.*"tag_name": "\(.*\)",/\1/p' )
4
+ if [[ $? == 1 ]]; then
5
+ error_exit " Failed to get latest release version"
6
+ fi
7
+
8
+ HOVERFLY_DOWNLOAD_URL=https://github.com/SpectoLabs/hoverfly/releases/download/${HOVERFLY_VERSION}
9
+
10
+
11
+ # Download distribution package for Linux
12
+ machine_type=$( uname -m)
13
+ if [[ ${machine_type} == " x86_64" ]]; then
14
+ asset_name=hoverfly_bundle_linux_amd64.zip
15
+ else
16
+ asset_name=hoverfly_bundle_linux_386.zip
17
+ fi
18
+
19
+ wget -O /tmp/hoverfly.zip ${HOVERFLY_DOWNLOAD_URL} /${asset_name}
20
+ if [[ $? == 1 ]]; then
21
+ error_exit " Failed to download hoverfly release package"
22
+ fi
23
+
24
+ # Unzip and copy to PATH
25
+ unzip -d /tmp/hoverfly /tmp/hoverfly.zip
26
+ sudo cp /tmp/hoverfly/hoverfly /usr/local/bin/
27
+ sudo cp /tmp/hoverfly/hoverctl /usr/local/bin/
28
+
29
+
30
+ # An error exit function
31
+ function error_exit
32
+ {
33
+ echo " $1 " 1>&2
34
+ exit 1
35
+ }
You can’t perform that action at this time.
0 commit comments