summaryrefslogtreecommitdiff
path: root/src/remove.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-03-03 19:12:05 +0000
committerdavidovski <david@davidovski.xyz>2022-03-03 19:12:05 +0000
commit4e244fa843a2cb53a137dede7caa304422e13f5c (patch)
tree0cd66079a30b31aa71a358e9db69b6d976628261 /src/remove.sh
parent6bc227cbffd0caa08d382f56df48cbb34f2afc59 (diff)
added cache cleaningv1.1.0
Diffstat (limited to 'src/remove.sh')
-rw-r--r--src/remove.sh12
1 files changed, 11 insertions, 1 deletions
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
+}