Skip to content

Commit

Permalink
Add environment check in bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
yanganto committed Jan 10, 2020
1 parent f800f67 commit 4222a5d
Showing 1 changed file with 46 additions and 4 deletions.
50 changes: 46 additions & 4 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,52 @@

# The script help you set up your develop envirnment

if [[ "$OSTYPE" == "linux-gnu" ]]; then
set -e
if [ -f /etc/redhat-release ]; then
echo "Redhat Linux detected, but current not support sorry."
echo "Contribution is always welcome."
exit 1
elif [ -f /etc/SuSE-release ]; then
echo "Suse Linux detected, but current not support sorry."
echo "Contribution is always welcome."
exit 1
elif [ -f /etc/arch-release ]; then
echo "Arch Linux detected."
sudo pacman -Syu --needed --noconfirm cmake gcc openssl-1.0 clang llvm rocksdb curl
export OPENSSL_LIB_DIR="/usr/lib/openssl-1.0";
export OPENSSL_INCLUDE_DIR="/usr/include/openssl-1.0"
elif [ -f /etc/mandrake-release ]; then
echo "Mandrake Linux detected, but current not support sorry."
echo "Contribution is always welcome."
exit 1
elif [ -f /etc/debian_version ]; then
echo "Ubuntu/Debian Linux detected."
sudo apt-get -y update
sudo apt-get install -y cmake pkg-config libssl-dev
else
echo "Unknown Linux distribution."
echo "Contribution is always welcome."
exit 1
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
set -e
echo "Mac OS (Darwin) detected."
if ! which brew >/dev/null 2>&1; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew upgrade
brew install openssl cmake llvm
elif [[ "$OSTYPE" == "freebsd"* ]]; then
echo "FreeBSD detected, but current not support sorry."
echo "Contribution is always welcome."
exit 1
else
echo "Unknown operating system."
echo "Contribution is always welcome."
exit 1
fi

# Setup git hooks
cp .hooks/* .git/hooks

Expand All @@ -13,7 +59,3 @@ rustup target add wasm32-unknown-unknown

# Install rustfmt for coding style checking
rustup component add rustfmt --toolchain nightly

# TODO: help other developers with different platform
sudo apt-get -y update
sudo apt-get install -y cmake pkg-config libssl-dev

0 comments on commit 4222a5d

Please sign in to comment.