-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.sh
executable file
·64 lines (43 loc) · 1.14 KB
/
clean.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
#!/usr/bin/env bash
###
# This script is basically the inverse of install.sh
###
set -e
DOTFILES_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. "${DOTFILES_ROOT}/scripts/prompt-utils.sh"
clean_gitconfig () {
if [ -f "${HOME}/.gitconfig" ]; then
info "Cleaning .gitconfig"
rm "${HOME}/.gitconfig"
success "Cleaned .gitconfig"
else
success "No .gitconfig"
fi
}
clean_zsh () {
if [ -d "${HOME}/.oh-my-zsh" ]; then
info "Cleaning ohmyzsh"
sh "${HOME}/.oh-my-zsh/tools/uninstall.sh"
chsh -s $(which bash)
success "Cleaned .zshrc"
else
success "No ohmyzsh"
fi
if [ -d "${HOME}/.poshthemes" ]; then
success "Found ohmyposh"
info "Cleaning ohmyposh"
sudo chmod -x /usr/local/bin/oh-my-posh
sudo rm /usr/local/bin/oh-my-posh
chmod u-rw "${HOME}/.poshthemes/"*.json
rm -rf "${HOME}/.poshthemes"
success "Cleaned ohmyposh"
else
success "No ohmyposh"
fi
}
confirm "Cleaning" "Aborting"
info "Starting dotfiles clean"
clean_gitconfig
clean_zsh
success "All done!"
exec bash