-
Notifications
You must be signed in to change notification settings - Fork 0
/
web-install.sh
60 lines (45 loc) · 1.16 KB
/
web-install.sh
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
os=''
LINUX='linux'
MAC='mac'
DOTFILES_PATH="$HOME/.dotfiles"
set -e
sudo='sudo'
if [ ! -z "$(command -v $sudo)" ]; then
sudo=''
fi
function cecho {
echo "$1$normal"
}
function ensure() {
local package=$1
local command=$2
if [ -z "$command" ]; then
command=$1
fi
if [ -x "$(command -v $command)" ]; then
cecho "$command$normal is already installed"
return
fi
echo "$package is not installed, installing... (you might be asked for your password)"
if [ "$os" == "$LINUX" ]; then
$sudo apt-get install -y $package
elif [ "$os" == "$MAC" ]; then
brew install $package
fi
}
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
os=$LINUX
echo "Detected OS: $os"
else
os=$MAC
echo "Detected OS: $os"
echo "Checking if brew is installed"
# make sure brew is installed
if [ -x "$(command -v brew)" ]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
fi
ensure git
git clone --recursive https://github.com/DeX3/dotfiles $DOTFILES_PATH
$DOTFILES_PATH/installer/install.sh