6
6
# # Helper Functions
7
7
8
8
function github_api {
9
- project=" $1 "
10
- github_api=" https://api.github.com/repos/${project} /releases/latest"
11
- curl -s " $github_api "
9
+ project=" $1 "
10
+ github_api=" https://api.github.com/repos/${project} /releases/latest"
11
+ curl -s " ${ github_api} "
12
12
}
13
13
14
14
function get_latest_version {
15
- github_api " $1 " | jq ' .tag_name' | tr -d ' v' | tr -d ' "'
15
+ github_api " $1 " | jq ' .tag_name' | tr -d ' v' | tr -d ' "'
16
16
}
17
17
18
18
function get_latest_artifact {
19
- github_api " $1 " | jq ' .assets[] | select(.name | test("linux")) | .browser_download_url' | tr -d ' "'
19
+ github_api " $1 " | jq ' .assets[] | select(.name | test("linux")) | .browser_download_url' | tr -d ' "'
20
20
}
21
21
22
22
# #######################################
@@ -32,8 +32,14 @@ export DEBIAN_FRONTEND=noninteractive
32
32
apt-get update
33
33
apt-get install -y jq s3cmd tmux python3-pip python3-venv
34
34
35
- echo " Installing doctl v$( get_latest_version " digitalocean/doctl" ) ..."
36
- curl -fsSL -o /tmp/doctl.tar.gz " $( get_latest_artifact " digitalocean/doctl" | grep " amd64" ) "
35
+ echo " Installing doctl v$(
36
+ set -e
37
+ get_latest_version " digitalocean/doctl"
38
+ ) ..."
39
+ curl -fsSL -o /tmp/doctl.tar.gz " $(
40
+ set -e
41
+ get_latest_artifact " digitalocean/doctl" | grep " amd64"
42
+ ) "
37
43
tar -xzf /tmp/doctl.tar.gz -C /tmp
38
44
mv /tmp/doctl /usr/local/bin
39
45
rm /tmp/doctl.tar.gz
@@ -48,16 +54,28 @@ source ~/venv/bin/activate
48
54
pip3 install solc-select slither-analyzer crytic-compile
49
55
solc-select use latest --always-install
50
56
51
- echo " Installing echidna v$( get_latest_version " crytic/echidna" ) ..."
52
- curl -fsSL -o /tmp/echidna.tar.gz " $( get_latest_artifact " crytic/echidna" | grep -v " sigstore" ) "
57
+ echo " Installing echidna v$(
58
+ set -e
59
+ get_latest_version " crytic/echidna"
60
+ ) ..."
61
+ curl -fsSL -o /tmp/echidna.tar.gz " $(
62
+ set -e
63
+ get_latest_artifact " crytic/echidna" | grep -v " sigstore"
64
+ ) "
53
65
tar -xzf /tmp/echidna.tar.gz -C /tmp
54
66
mv /tmp/echidna /usr/local/bin
55
67
chmod +x /usr/local/bin/echidna
56
68
rm /tmp/echidna.tar.gz
57
69
echo " Done installing: $( echidna --version) "
58
70
59
- echo " Installing medusa v$( get_latest_version " crytic/medusa" ) ..."
60
- curl -fsSL -o /tmp/medusa.tar.gz " $( get_latest_artifact " crytic/medusa" | grep -v " sigstore" ) "
71
+ echo " Installing medusa v$(
72
+ set -e
73
+ get_latest_version " crytic/medusa"
74
+ ) ..."
75
+ curl -fsSL -o /tmp/medusa.tar.gz " $(
76
+ set -e
77
+ get_latest_artifact " crytic/medusa" | grep -v " sigstore"
78
+ ) "
61
79
tar -xzf /tmp/medusa.tar.gz -C /tmp
62
80
sudo mv /tmp/medusa /usr/local/bin
63
81
chmod +x /usr/local/bin/medusa
0 commit comments