mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 15:04:42 +00:00
fix: handle dotfiles in Trash cleanup (#395)
Replace glob pattern with find command to properly clean dotfiles in Trash when osascript fallback is used. The old pattern ~/.Trash/* does not match files starting with "." in bash. This fix ensures that hidden files like .DS_Store, .hidden_file, etc. are properly removed when cleaning the Trash.
This commit is contained in:
@@ -20,7 +20,9 @@ clean_user_essentials() {
|
||||
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Trash · emptied, $trash_count items"
|
||||
note_activity
|
||||
else
|
||||
safe_clean ~/.Trash/* "Trash"
|
||||
while IFS= read -r -d '' item; do
|
||||
safe_remove "$item" true || true
|
||||
done < <(command find "$HOME/.Trash" -mindepth 1 -maxdepth 1 -print0 2> /dev/null || true)
|
||||
fi
|
||||
else
|
||||
echo -e " ${GRAY}${ICON_EMPTY}${NC} Trash · already empty"
|
||||
|
||||
Reference in New Issue
Block a user