-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap2.sh
executable file
·66 lines (53 loc) · 2.23 KB
/
bootstrap2.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
#!/usr/bin/env bash
git pull origin master;
source get_plugins.sh
function doIt() {
# Backing up original files to backup folder in dotfiles
mv ~/.bash_profile $PWD/backup/.bash_profile.orig 2>/dev/null
mv ~/.bashrc $PWD/backup/.bashrc.orig 2>/dev/null
mv ~/.zshrc $PWD/backup/.zshrc.orig 2>/dev/null
mv ~/.vimrc $PWD/backup/.vimrc.orig 2>/dev/null
mv ~/.vim/ $PWD/backup/.vim.orig 2>/dev/null
mv ~/.plugins.vim $PWD/backup/.plugins.vim.orig 2>/dev/null
mv ~/.basic.vim $PWD/backup/.basic.vim.orig 2>/dev/null
mv ~/.mappings.vim $PWD/backup/.mappings.vim.orig 2>/dev/null
mv ~/.aliases $PWD/backup/.aliases.orig 2>/dev/null
mv ~/.aliases_work $PWD/backup/.aliases_work.orig 2>/dev/null
mv ~/.aliases_mac $PWD/backup/.aliases_mac.orig 2>/dev/null
mv ~/.aliases_docker $PWD/backup/.aliases_docker.orig 2>/dev/null
mv ~/.aliases_kubectl $PWD/backup/.aliases_kubectl.orig 2>/dev/null
mv ~/.deep_learning $PWD/backup/.deep_learning.orig 2>/dev/null
mv ~/.tmux.conf $PWD/backup/.tmux.conf.orig 2>/dev/null
# Create links for alias/sourcing files
ln -s $PWD/zshrc ~/.zshrc
ln -s $PWD/aliases/aliases ~/.aliases
ln -s $PWD/aliases/aliases_work ~/.aliases_work
ln -s $PWD/aliases/aliases_mac ~/.aliases_mac
ln -s $PWD/aliases/aliases_mac_m1 ~/.aliases_mac_m1
ln -s $PWD/aliases/aliases_docker ~/.aliases_docker
ln -s $PWD/aliases/aliases_kubectl ~/.aliases_kubectl
ln -s $PWD/aliases/deep_learning ~/.deep_learning
ln -s $PWD/.bashrc ~/.bashrc
ln -s $PWD/.bash_profile ~/.bash_profile
ln -s $PWD/.tmux.conf ~/.tmux.conf
if [ ! -f ~/.oh-my-zsh/themes/naren.zsh-theme ];
then
ln -s $PWD/zsh_themes/naren.zsh-theme ~/.oh-my-zsh/themes/naren.zsh-theme
fi
# Vim setup
ln -s $PWD/vimfiles/.vimrc ~/.vimrc
ln -s $PWD/vimfiles/plugins.vim ~/.plugins.vim
ln -s $PWD/vimfiles/basic.vim ~/.basic.vim
ln -s $PWD/vimfiles/mappings.vim ~/.mappings.vim
cp -r $PWD/vimfiles/vim ~/.vim
}
if [ "$1" == "--force" -o "$1" == "-f" ]; then
doIt;
else
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
doIt;
fi;
fi;
unset doIt;