|
1 | 1 | #!/usr/bin/env bash
|
2 |
| - |
| 2 | +# |
3 | 3 | # The script help you set up your develop envirnment
|
| 4 | +# |
| 5 | +# --fast: fast mode will skip OS pacakge dependency, only install git hooks and Rust |
| 6 | +# |
4 | 7 |
|
5 |
| -if [[ "$OSTYPE" == "linux-gnu" ]]; then |
6 |
| - set -e |
7 |
| - if [ -f /etc/redhat-release ]; then |
8 |
| - echo "Redhat Linux detected, but current not support sorry." |
9 |
| - echo "Contribution is always welcome." |
10 |
| - exit 1 |
11 |
| - elif [ -f /etc/SuSE-release ]; then |
12 |
| - echo "Suse Linux detected, but current not support sorry." |
13 |
| - echo "Contribution is always welcome." |
14 |
| - exit 1 |
15 |
| - elif [ -f /etc/arch-release ]; then |
16 |
| - echo "Arch Linux detected." |
17 |
| - sudo pacman -Syu --needed --noconfirm cmake gcc openssl-1.0 clang llvm rocksdb curl |
18 |
| - export OPENSSL_LIB_DIR="/usr/lib/openssl-1.0"; |
19 |
| - export OPENSSL_INCLUDE_DIR="/usr/include/openssl-1.0" |
20 |
| - elif [ -f /etc/mandrake-release ]; then |
21 |
| - echo "Mandrake Linux detected, but current not support sorry." |
22 |
| - echo "Contribution is always welcome." |
23 |
| - exit 1 |
24 |
| - elif [ -f /etc/debian_version ]; then |
25 |
| - echo "Ubuntu/Debian Linux detected." |
26 |
| - sudo apt-get -y update |
27 |
| - sudo apt-get install -y cmake pkg-config libssl-dev |
28 |
| - else |
29 |
| - echo "Unknown Linux distribution." |
30 |
| - echo "Contribution is always welcome." |
31 |
| - exit 1 |
32 |
| - fi |
33 |
| -elif [[ "$OSTYPE" == "darwin"* ]]; then |
34 |
| - set -e |
35 |
| - echo "Mac OS (Darwin) detected." |
36 |
| - if ! which brew >/dev/null 2>&1; then |
37 |
| - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
38 |
| - fi |
39 |
| - brew upgrade |
40 |
| - brew install openssl cmake llvm |
41 |
| -elif [[ "$OSTYPE" == "freebsd"* ]]; then |
42 |
| - echo "FreeBSD detected, but current not support sorry." |
43 |
| - echo "Contribution is always welcome." |
44 |
| - exit 1 |
45 |
| -else |
46 |
| - echo "Unknown operating system." |
47 |
| - echo "Contribution is always welcome." |
48 |
| - exit 1 |
| 8 | +if [[ "$1" != "--fast" ]]; then |
| 9 | + if [[ "$OSTYPE" == "linux-gnu" ]]; then |
| 10 | + set -e |
| 11 | + if [ -f /etc/redhat-release ]; then |
| 12 | + echo "Redhat Linux detected, but current not support sorry." |
| 13 | + echo "Contribution is always welcome." |
| 14 | + exit 1 |
| 15 | + elif [ -f /etc/SuSE-release ]; then |
| 16 | + echo "Suse Linux detected, but current not support sorry." |
| 17 | + echo "Contribution is always welcome." |
| 18 | + exit 1 |
| 19 | + elif [ -f /etc/arch-release ]; then |
| 20 | + echo "Arch Linux detected." |
| 21 | + sudo pacman -Syu --needed --noconfirm cmake gcc openssl-1.0 clang llvm rocksdb curl |
| 22 | + export OPENSSL_LIB_DIR="/usr/lib/openssl-1.0"; |
| 23 | + export OPENSSL_INCLUDE_DIR="/usr/include/openssl-1.0" |
| 24 | + elif [ -f /etc/mandrake-release ]; then |
| 25 | + echo "Mandrake Linux detected, but current not support sorry." |
| 26 | + echo "Contribution is always welcome." |
| 27 | + exit 1 |
| 28 | + elif [ -f /etc/debian_version ]; then |
| 29 | + echo "Ubuntu/Debian Linux detected." |
| 30 | + sudo apt-get -y update |
| 31 | + sudo apt-get install -y cmake pkg-config libssl-dev |
| 32 | + else |
| 33 | + echo "Unknown Linux distribution." |
| 34 | + echo "Contribution is always welcome." |
| 35 | + exit 1 |
| 36 | + fi |
| 37 | + elif [[ "$OSTYPE" == "darwin"* ]]; then |
| 38 | + set -e |
| 39 | + echo "Mac OS (Darwin) detected." |
| 40 | + if ! which brew >/dev/null 2>&1; then |
| 41 | + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
| 42 | + fi |
| 43 | + brew upgrade |
| 44 | + brew install openssl cmake llvm |
| 45 | + elif [[ "$OSTYPE" == "freebsd"* ]]; then |
| 46 | + echo "FreeBSD detected, but current not support sorry." |
| 47 | + echo "Contribution is always welcome." |
| 48 | + exit 1 |
| 49 | + else |
| 50 | + echo "Unknown operating system." |
| 51 | + echo "Contribution is always welcome." |
| 52 | + exit 1 |
| 53 | + fi |
49 | 54 | fi
|
50 | 55 |
|
51 | 56 | # Setup git hooks
|
|
0 commit comments