-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupgrade.sh
executable file
·59 lines (48 loc) · 1.22 KB
/
upgrade.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
#!/bin/bash
. ~/.bothrc
if [ ! -d "dotfiles" ]
then
cd ~/config/
fi
if [ ! -d "dotfiles" ]
then
echo "Run this from the config/ directory, please ; there should be a 'dotfiles' dir in the place you run this."
exit 1
fi
if [ ! "$HOME" ]
then
echo "Need a \$HOME."
exit 1
fi
if [ -h "$HOME/.fzf.bash" ]
then
rm "$HOME/.fzf.bash"
fi
if [ -h "$HOME/.fzf.zsh" ]
then
rm "$HOME/.fzf.zsh"
fi
mkdir -p $HOME/.vimtmp
chmod 600 github-config-readonly.ssh*
ssh-agent bash -c 'ssh-add github-config-readonly.ssh ; git pull'
yes | vim -c ':PlugInstall' -c ':qa'
yes | vim -c ':PlugUpdate' -c ':qa'
yes | vim -c ':VimProcInstall' -c ':qa'
yes | vim -c ':PlugUpdate' -c ':qa'
yes | vim -c ':PlugClean!' -c ':qa'
if [ -d ~/.fzf ]
then
yes | ~/.fzf/install
echo "Fixing fzf for HOME portability"
sed -i "s:$HOME:\$HOME:g" ~/.fzf.*
fi
echo "Setting up tpm"
if [ ! -d "$HOME/.tmux/plugins/tpm" ]
then
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
fi
cd ~/.tmux/plugins/tpm
# Force complete plugin refresh, as otherwise it doesn't seem to update
ls -d ~/.tmux/plugins/* | grep -v -P '\.tmux/plugins/tpm/?$' | xargs \rm -rf
$HOME/.tmux/plugins/tpm/scripts/install_plugins.sh
tmux source "$(readlink -f ~/.tmux.conf)"