-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·67 lines (59 loc) · 1.38 KB
/
install.sh
File metadata and controls
executable file
·67 lines (59 loc) · 1.38 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
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
#!/bin/bash
# Lovingly copied from thoughtbot, inc.
# Distributed under the MIT license, copyright 2009-2013
DO_NOT_COPY="install.sh README.md LICENSE"
copy_files() {
for name in *; do
target="$HOME/.$name"
if [ -e "$target" ]; then
if [ ! -L "$target" ]; then
echo "WARNING: Not overwriting existing file $target which is not a symlink."
fi
else
if [[ ! $DO_NOT_COPY =~ (^|[[:space:]])"$name"($|[[:space:]]) ]]; then
echo "Creating $target"
ln -s "$PWD/$name" "$target"
fi
fi
done
}
install_vim_bundles() {
#if [ ! -e ~/.vim/bundle/vundle ]; then
# git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
#fi
echo "Installing vim bundles..."
vim -u ~/.vimrc.bundles +BundleInstall +qa
}
#install_oh_my_zsh() {
# if [ ! -e "$HOME/.oh-my-zsh" ]
#}
use_zsh() {
if [ "$SHELL" != "/bin/zsh" ]; then
if ! command zsh; then
echo "You do not have zsh installed - install then re-run this script."
exit 1
fi
echo "Changing to login shell zsh"
chsh -s /bin/zsh
zsh
fi
echo "Re-sourcing .zshrc"
zsh "$HOME/.zshrc"
}
cd "$HOME"
if [ ! -e "dotfiles" ]; then
if ! git clone https://github.com/fish-face/dotfiles; then
echo "Unable to clone dotfiles repo."
exit 1
fi
fi
cd dotfiles
if ! git pull; then
echo "Error pulling dotfiles."
exit 1
fi
git submodule init
git submodule update --recursive
copy_files
install_vim_bundles
use_zsh