mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-27 00:35:18 +00:00
add mac support
This commit is contained in:
parent
00b4923f94
commit
5750f5e69b
@ -1,10 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Install dependent libraries
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||||
go version 2>/dev/null || sudo snap install go --classic
|
# Install dependent libraries
|
||||||
jq --version 2>/dev/null || sudo snap install jq
|
go version 2>/dev/null || sudo snap install go --classic
|
||||||
make --version 2>/dev/null || sudo apt install make -y
|
jq --version 2>/dev/null || sudo snap install jq
|
||||||
gcc --version 2>/dev/null || (sudo apt-get update; sudo apt install gcc -y)
|
make --version 2>/dev/null || sudo apt install make -y
|
||||||
|
gcc --version 2>/dev/null || (sudo apt-get update; sudo apt install gcc -y)
|
||||||
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
# Install dependent libraries
|
||||||
|
go version 2>/dev/null || brew install go
|
||||||
|
jq --version 2>/dev/null || brew install jq
|
||||||
|
make --version 2>/dev/null || brew install make
|
||||||
|
gcc --version 2>/dev/null || brew install gcc
|
||||||
|
fi
|
||||||
|
|
||||||
# Build binary
|
# Build binary
|
||||||
export PATH=$PATH:$(go env GOPATH)/bin
|
export PATH=$PATH:$(go env GOPATH)/bin
|
||||||
@ -15,7 +23,6 @@ if [[ $? -ne 0 ]]; then
|
|||||||
cd $SCRIPT_DIR/../..
|
cd $SCRIPT_DIR/../..
|
||||||
rm -rf $(go env GOPATH)/bin/0gchaind
|
rm -rf $(go env GOPATH)/bin/0gchaind
|
||||||
make install
|
make install
|
||||||
|
|
||||||
# Add gopath to path
|
# Add gopath to path
|
||||||
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.profile
|
echo 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.profile
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user