-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
39 lines (34 loc) · 1.06 KB
/
bootstrap.sh
File metadata and controls
39 lines (34 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
cd "$(dirname "$0")" || exit 1
# Check if bash is the main shell
if [[ $SHELL == /bin/bash ]]; then
echo "$SHELL"
else
chsh -s /bin/bash
fi
# Check if xcode is installed on mac
if [ "$(uname)" == "Darwin" ]; then
if command -v xcode-select >/dev/null 2>&1; then
echo "xcode-select already installed"
else
echo "xcode-select not found"
xcode-select --install
fi
fi
# Check homebrew installer is available
if command -v brew >/dev/null 2>&1; then
echo "brew already installed"
else
echo "brew not found"
if [ "$(uname)" == "Darwin" ]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
fi
if [[ -x /home/linuxbrew/.linuxbrew/bin/brew ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
elif [[ -x "$HOME/.linuxbrew/bin/brew" ]]; then
eval "$("$HOME/.linuxbrew/bin/brew" shellenv)"
fi
fi
bash setup.sh