We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9cdc3d1 commit 58ac6dfCopy full SHA for 58ac6df
udroid/src/udroid.sh
@@ -983,8 +983,20 @@ _reset() {
983
clear_cache() {
984
TITLE "> CLEAR CACHE"
985
cache_size=$(du -sh -d 0 $DLCACHE | awk '{print $1}')
986
- g_spin "line" "Clearing cache" -- rm -rf $DLCACHE/*
987
- echo -e "Cache cleared ($cache_size).."
+
+ # check if cache is empty
988
+ if [[ $cache_size == "0" ]]; then
989
+ GWARN "cache is already empty"
990
+ exit 0
991
+ fi
992
993
+ # ask for confirmation
994
+ if ask "Are you sure you want to clear cache?"; then
995
+ rm -rf $DLCACHE/*
996
+ echo "$cache_size cache cleared"
997
+ else
998
+ GWARN "cache not cleared"
999
1000
}
1001
####################
1002
download() {
0 commit comments