-
Notifications
You must be signed in to change notification settings - Fork 1
/
uninstall.sh
executable file
·51 lines (35 loc) · 1.09 KB
/
uninstall.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
#!/bin/bash
DOTFILESHOME="${ZDOTDIR:-$HOME}"
echo -e "uninstalling zprezto...\n"
for rcfile in "$DOTFILESHOME"/dotfiles/.zprezto/runcoms/*; do
if [ ! "${rcfile##*/}" = "README.md" ]; then
rm -f "$DOTFILESHOME/.${rcfile##*/}"
fi
rm -f "$DOTFILESHOME/.zprezto"
done
echo "removing current dotfiles"
for rcfile in "$DOTFILESHOME"/dotfiles/runcoms/*; do
rm -f "$DOTFILESHOME/.${rcfile##*/}"
done
echo "restoring old dotfiles"
shopt -s dotglob
for rcfile in "$DOTFILESHOME"/dotfiles/backup/runcoms/*; do
if [ -f "$rcfile" ]; then
mv $rcfile "$DOTFILESHOME"
fi
done
shopt -u dotglob
echo "restoring bin folder"
rm "$DOTFILESHOME"/bin
if [ -d "$DOTFILESHOME"/dotfiles/backup/bin ]; then
cp -r "$DOTFILESHOME"/dotfiles/backup/bin "$DOTFILESHOME"
fi
rm -rf "$DOTFILESHOME"/dotfiles/backup
echo "restoring .vim folder"
rm "$DOTFILESHOME"/.vim
if [ -d "$DOTFILESHOME"/dotfiles/backup/vim ]; then
cp -r "$DOTFILESHOME"/dotfiles/backup/vim "$DOTFILESHOME/.vim"
fi
rm -rf "$DOTFILESHOME"/dotfiles/backup
unset DOTFILESHOME
echo -e "\n...done uninstalling dotfiles"