1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 21:55:08 +00:00

refactor(clean): optimize Group Containers directory check

- Replace ls with find -maxdepth 1 to reduce IO and permission noise
- Keep same behavior: silently skip if directory is empty or inaccessible

Addresses: user.sh (line 484)
This commit is contained in:
tw93
2026-02-21 20:22:06 +08:00
parent 9440d9e52a
commit ef0e34a214

View File

@@ -481,7 +481,7 @@ process_container_cache() {
clean_group_container_caches() {
local group_containers_dir="$HOME/Library/Group Containers"
[[ -d "$group_containers_dir" ]] || return 0
if ! ls "$group_containers_dir" > /dev/null 2>&1; then
if ! find "$group_containers_dir" -mindepth 1 -maxdepth 1 -print -quit 2> /dev/null | grep -q .; then
return 0
fi