-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·59 lines (48 loc) · 1.25 KB
/
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
function install_cel {
if command_exists cel; then
colored_echo "cel already installed. Skipping."; return;
fi
sudo curl https://raw.githubusercontent.com/Dinduks/change-execute-loop/master/cel -o /usr/local/bin/cel
sudo chmod +x /usr/local/bin/cel
}
function install_hr {
if command_exists hr; then
colored_echo "hr already installed. Skipping."; return;
fi
sudo curl https://raw.githubusercontent.com/LuRsT/hr/master/hr -o /usr/local/bin/hr
sudo chmod +x /usr/local/bin/hr
}
function setup_scripts {
for script in scripts/*; do
sudo ln -s $PWD/$script /usr/local/bin &> /dev/null
done
}
function setup_vim {
ln -s $PWD/vim/.vim ~ &> /dev/null
ln -s $PWD/vim/.vimrc ~ &> /dev/null
}
function setup_git {
ln -s $PWD/git/.gitconfig ~ &> /dev/null
ln -s $PWD/git/.gitignore_global ~ &> /dev/null
}
function setup_zsh_config {
ln -s $PWD/dinduks.zsh ~/.oh-my-zsh/custom &> /dev/null
}
# From http://stackoverflow.com/a/3931779
command_exists () {
type "$1" &> /dev/null;
}
colored_echo () {
echo -e "\e[33m$1\e[39m"
}
function run {
colored_echo "Running $1..."
eval $1
colored_echo "Finished running $1.\n"
}
run "setup_vim"
run "setup_git"
run "setup_zsh_config"
run "install_cel"
run "install_hr"
run "setup_scripts"