mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
21 lines
594 B
Bash
21 lines
594 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# Install dependent libraries
|
||
|
go version 2>/dev/null || sudo snap install go --classic
|
||
|
jq --version 2>/dev/null || sudo snap install jq
|
||
|
make --version 2>/dev/null || sudo apt install make -y
|
||
|
gcc --version 2>/dev/null || (sudo apt-get update; sudo apt install gcc -y)
|
||
|
|
||
|
# Build binary
|
||
|
export PATH=$PATH:$(go env GOPATH)/bin
|
||
|
0gchaind version 2>/dev/null
|
||
|
if [[ $? -ne 0 ]]; then
|
||
|
# Make under root dir
|
||
|
SCRIPT_DIR=`dirname "${BASH_SOURCE[0]}"`
|
||
|
cd $SCRIPT_DIR/../..
|
||
|
make install
|
||
|
|
||
|
# Add gopath to path
|
||
|
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.profile
|
||
|
fi
|