-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
35 lines (32 loc) · 998 Bytes
/
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
#!/bin/bash
replaceLink(){
# Assumption is that existence of .olddotfiles means deleting the link
# won't delete anything important.
if [ -L ~/$1 ]
then
if [ -d ~/.olddotfiles/$1 -o -f ~/.olddotfiles/$1 ]; then
rm ~/$1
cp -rf ~/.olddotfiles/$1 ~/
else
echo $1 not found in ~/.dotfiles, so we
echo will not be replacing that.
fi
else
echo $1 link not found in ~/
fi
}
if [ -d ~/.olddotfiles ]
then
replaceLink .bashrc
replaceLink .bash_profile
replaceLink .bash_aliases
replaceLink .vimrc
replaceLink .vim
echo "Finished transfering backed up dot files."
echo "Check to make sure that the contents of"
echo "~/.olddotfiles matches the contents of ~/"
echo "and run rm -rf ~/.olddotfiles to finish uninstall"
else
echo "You don't have a folder of old dotfiles."
echo "No way to uninstall."
fi