functions: Add clean cache function

This commit is contained in:
timoxa0 2024-11-03 16:38:26 +05:00
parent 3afb37e6a7
commit f1385304eb

View file

@ -82,6 +82,10 @@ arguments() {
cleanraw
exit $? ;;
-w | --cleancache)
cleancache
exit $? ;;
-h | -help | --help)
usage
exit $? ;;
@ -107,6 +111,9 @@ usage() {
# Clean raw images
$0 --cleanraw or -r
# Clean cache
$0 --cleancache or -w
# Build LNIBUILD
$0 <path/to/LNIBUILD>
EOF
@ -142,6 +149,15 @@ cleanraw()
rm ./raw/* -f && log "Done!"
}
cleancache()
{
find ./cache/ -mindepth 1 -maxdepth 1 | read || {
[ -z ${quiet+x} ] && log "Nothing to clean" error
return 0
}
rm ./cache/* -f && log "Done!"
}
# shellcheck disable=SC2317
_shutdown()
{