From 4e244fa843a2cb53a137dede7caa304422e13f5c Mon Sep 17 00:00:00 2001 From: davidovski Date: Thu, 3 Mar 2022 19:12:05 +0000 Subject: added cache cleaning --- src/remove.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/remove.sh') diff --git a/src/remove.sh b/src/remove.sh index 67bbbdd..7bbb889 100644 --- a/src/remove.sh +++ b/src/remove.sh @@ -39,10 +39,20 @@ remove () { removed=$((removed+1)) ${QUIET} || hbar ${HBAR_RED} -T "removing files" $removed $total done - ${QUIET} || hbar -t ${HBAR_COMPLETE} -T "removing files" $removed $total + ${QUIET} || hbar -t ${HBAR_COMPLETE} -T "removed files" $removed $total else ${QUIET} || printf "${LIGHT_BLACK}Action cancled by user\n" fi } +clean () { + set -- $(du -sh ${CACHE_DIR}) + + if prompt_question "${LIGHT_RED}Remove ${RED}$1${LIGHT_RED} of cached files?"; then + rm -rf ${CACHE_DIR}/* + ${QUIET} || printf "${GREEN}Cleared package cache!\n" + else + ${QUIET} || printf "${LIGHT_BLACK}Action cancled by user\n" + fi +} -- cgit v1.2.1