forked from taybart/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
executable file
·83 lines (78 loc) · 2.11 KB
/
setup
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
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
install_zsh () {
# Test to see if zshell is installed. If it is:
if [ -f /bin/zsh -o -f /usr/bin/zsh ]; then
# Clone my oh-my-zsh repository from GitHub only if it isn't already present
if [[ ! -d $dir/oh-my-zsh/ ]]; then
git clone http://github.com/robbyrussell/oh-my-zsh.git
fi
# Set the default shell to zsh if it isn't currently set to zsh
if [[ ! $(echo $SHELL) == $(which zsh) ]]; then
chsh -s $(which zsh)
fi
else
# If zsh isn't installed, get the platform of the current machine
platform=$(uname);
# If the platform is Linux, try an apt-get to install zsh and then recurse
if [[ $platform == 'Linux' ]]; then
sudo apt-get install zsh
install_zsh
# If the platform is OS X, go install zsh
elif [[ $platform == 'Darwin' ]]; then
echo "Please install zsh, then re-run this script!"
exit
fi
fi
}
install_zsh
if [ -e $HOME/.zshrc ]
then
read -p "Replace .zshrc?" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
ln -s $HOME/.dotfiles/zshrc $HOME/.zshrc
fi
else
mv $HOME/.zshrc .zshrccpy
ln -s $HOME/.dotfiles/zshrc $HOME/.zshrc
fi
if [ -e $HOME/.oh-my-zsh ]
then
read -p "Replace .oh-my-zsh?" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
ln -s $HOME/.dotfiles/oh-my-zsh $HOME/.oh-my-zsh
else
mv $HOME/.oh-my-zsh .oh-my-zshcpy
fi
fi
if [ -e $HOME/.vimrc ]
then
read -p "Replace .vimrc?" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
ln -s $HOME/.dotfiles/vimrc $HOME/.vimrc
else
mv $HOME/.vimrc .vimrccpy
fi
fi
if [ -e $HOME/.zshrc ]
then
read -p "Replace .vim?" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
ln -s $HOME/.dotfiles/vim $HOME/.vim
else
mv $HOME/.vim .vimcpy
fi
fi
if [ -e $HOME/.zshrc ]
then
read -p "Replace .pentadactylrc?" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
ln -s $HOME/.dotfiles/pentadactylrc $HOME/.pentadactylrc
else
mv $HOME/.pentadactylrc .pentadactylrccpy
fi
fi