-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
executable file
·51 lines (43 loc) · 1.37 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
#!/bin/bash
source lib.sh
source conf.sh
function install_packages {
# if no sudo installed, just evaluate the expression
if ! command_exists sudo; then
# creating a alias don't will work
function sudo {
eval "$@"
}
fi
# install main packages
if command_exists pacman; then
echo_info info "Arch Linux based: using pacman."
sudo pacman -Sy --needed ${PACKAGES[@]}
elif command_exists apt-get; then
echo_info info "Debian based: using apt-get."
sudo apt-get update && sudo apt-get install ${PACKAGES[@]}
fi
[[ -f $DEFAULT_SHELL ]] && chsh -s $DEFAULT_SHELL
}
# install prelude for emacs
function install_prelude {
cd ~/.emacs.d/
if [ ! -d .git ]; then
git clone --bare https://github.com/bbatsov/prelude.git .git --quiet
git config --unset core.bare
git reset --hard @ --quiet
fi
cd ~/
}
# install vim Vundle to handle plugins
function install_vim_deps {
mkdir -p ~/.vim/bundle/
[[ -d ~/.vim/bundle/Vundle.vim/ ]] || git clone https://github.com/VundleVim/Vundle.vim.git \
~/.vim/bundle/Vundle.vim --quiet
}
echo_info installing "system packages: ${PACKAGES[@]}"
install_packages
echo_info installing "prelude for emacs..."
install_prelude
echo_info installing "vim deps..."
install_vim_deps