backup cleaner added to setup

This commit is contained in:
Wryn Wagner 2020-09-10 20:06:49 +00:00
parent b09fa8617c
commit 736755f329

16
setup
View File

@ -168,6 +168,20 @@ function CONFIG__SETUP() {
### RUN CONFIG ################################################################# ### RUN CONFIG #################################################################
################################################################################ ################################################################################
function CLEAN_BACKUP() {
read -p "Clean backup files? [yN] : " yn;
case $yn in
[Yy]* )
echo 'cleaning backup files';
for file in $(find "$HOME/.config/" -name \*.bak); do rm $file; done
for file in $(find "$HOME" -name .\*.bak); do rm $file; done
;;
* ) echo 'skipping cleanup';;
esac
}
[ ! -d "$HOME/.config" ] && mkdir "$HOME/.config"; [ ! -d "$HOME/.config" ] && mkdir "$HOME/.config";
[ ! -d "$HOME/.config/wryn" ] && mkdir "$HOME/.config/wryn"; [ ! -d "$HOME/.config/wryn" ] && mkdir "$HOME/.config/wryn";
@ -175,4 +189,6 @@ SHELL__SETUP;
VIM__SETUP; VIM__SETUP;
CONFIG__SETUP; CONFIG__SETUP;
CLEAN_BACKUP;
echo -e "\nsetup complete" echo -e "\nsetup complete"