|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 | 3 | # Check if foundry is installed
|
4 |
| -if ! command -v $HOME/.foundry/bin/forge &>/dev/null; then |
| 4 | +if ! command -v forge &>/dev/null; then |
5 | 5 | # Install foundryup
|
6 | 6 | curl -L https://foundry.paradigm.xyz | bash
|
7 | 7 | # Install foundry
|
8 | 8 | $HOME/.foundry/bin/foundryup
|
9 |
| -fi |
10 |
| - |
11 |
| -$HOME/.foundry/bin/forge soldeer update |
12 |
| -# Run forge build |
13 |
| -$HOME/.foundry/bin/forge build |
14 | 9 |
|
15 |
| -# Check if homebrew is installed |
16 |
| -if ! command -v brew &>/dev/null; then |
17 |
| - # Install homebrew |
18 |
| - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
| 10 | + $HOME/.foundry/bin/forge soldeer update |
| 11 | + # Run forge build |
| 12 | + $HOME/.foundry/bin/forge build |
19 | 13 | fi
|
20 | 14 |
|
21 | 15 | # Check if jq is installed
|
22 | 16 | if ! command -v jq &>/dev/null; then
|
23 | 17 | # Install jq
|
24 |
| - brew install jq |
| 18 | + sudo apt-get install jq |
25 | 19 | fi
|
26 | 20 |
|
27 | 21 | # Check if yq is installed
|
28 | 22 | if ! command -v yq &>/dev/null; then
|
29 |
| - # Install yq |
30 |
| - brew install yq |
| 23 | + curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/bin/yq && |
| 24 | + sudo chmod +x /usr/bin/yq |
31 | 25 | fi
|
32 | 26 |
|
33 | 27 | # Check if gvm is installed
|
34 |
| -if ! command -v gvm &>/dev/null; then |
| 28 | +if ! command -v go &>/dev/null; then |
35 | 29 | # Install bison
|
36 |
| - brew install bison |
| 30 | + sudo apt-get install bison |
37 | 31 | # Install gvm
|
38 | 32 | bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
|
39 |
| -fi |
40 |
| - |
41 |
| -# Source gvm script |
42 |
| -source ~/.gvm/scripts/gvm |
43 |
| -# Install go1.19 |
44 |
| -gvm install go1.19 -B |
| 33 | + # Source gvm script |
| 34 | + source $HOME/.gvm/scripts/gvm |
| 35 | + sudo apt-get install bsdmainutils |
45 | 36 |
|
46 |
| -rm -rf temp |
47 |
| -mkdir temp |
48 |
| -cd temp |
49 |
| -ls |
50 |
| - |
51 |
| -git clone [email protected]:ronin-chain/ronin-random-beacon.git |
| 37 | + # Install go1.19 |
| 38 | + gvm install go1.19 -B |
| 39 | +fi |
52 | 40 |
|
53 |
| -cd ronin-random-beacon |
| 41 | +rm -rf temp && mkdir temp && cd temp |
54 | 42 |
|
55 |
| -gvm use go1.19 && go build -o ronin-random-beacon |
| 43 | +git clone https://github.com/ronin-chain/ronin-random-beacon.git && cd ronin-random-beacon |
56 | 44 |
|
57 |
| -cp ronin-random-beacon ../../bin/ && cd ../../ |
| 45 | +# Check if installed gvm |
| 46 | +if ! command -v gvm &>/dev/null; then |
| 47 | + gvm use go1.19 |
| 48 | +fi |
58 | 49 |
|
59 |
| -rm -rf temp |
| 50 | +go build -o ronin-random-beacon && cp ronin-random-beacon ../../bin/ && cd ../../ && rm -rf temp |
0 commit comments