-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·70 lines (59 loc) · 1.34 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
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
set -e
set -o pipefail
abort() { echo "!!! $*" >&2; exit 1; }
log() { echo "--> $*"; }
logn() { printf -- "--> $* "; }
logk() { echo "OK"; }
readonly dotfiles="${HOME}/.dotfiles"
if [[ ! -d $dotfiles ]]; then
log "Cloning dotfiles:"
git clone https://github.com/dgoodlad/dotfiles $dotfiles
logk
fi
which stow 2>&1 >/dev/null || {
if (which brew 2>&1 >/dev/null); then
brew install stow
else
abort "Missing GNU stow; please install it then re-run $0"
fi
}
pushd ${dotfiles} >/dev/null
log "Installing OS-independent dotfiles:"
stow emacs
stow git
stow mail
stow mutt
stow readline
stow ruby
stow tmux
stow util
stow vim
stow zsh
logk
if [ ! -d $HOME/.emacs.d ]; then
log "Installing spacemacs:"
git clone https://github.com/syl20bnr/spacemacs $HOME/.emacs.d
logk
fi
if [ ! -d $HOME/.oh-my-zsh ]; then
log "Installing oh-my-zsh:"
git clone https://github.com/robbyrussell/oh-my-zsh $HOME/.oh-my-zsh
logk
fi
if [ ! -d $HOME/.vim/bundle/Vundle.vim ]; then
log "Installing Vundle.vim:"
git clone https://github.com/VundleVim/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim
vim +PluginInstall +qall
logk
fi
readonly os=$(uname -s)
log "Installing dotfiles for ${os}"
if [[ "${os}" == "Darwin" ]]; then
stow osx
else
stow X11
stow awesome
fi
logk
popd >/dev/null