From 736755f329fc9e64f888f6aeca831cd8b49d45ee Mon Sep 17 00:00:00 2001 From: Wryn Wagner Date: Thu, 10 Sep 2020 20:06:49 +0000 Subject: [PATCH] backup cleaner added to setup --- setup | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup b/setup index 02dceca..78a13f0 100755 --- a/setup +++ b/setup @@ -168,6 +168,20 @@ function CONFIG__SETUP() { ### 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/wryn" ] && mkdir "$HOME/.config/wryn"; @@ -175,4 +189,6 @@ SHELL__SETUP; VIM__SETUP; CONFIG__SETUP; +CLEAN_BACKUP; + echo -e "\nsetup complete"