mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 00:00:10 +00:00
Fix optimize compatibility at some times
This commit is contained in:
@@ -213,8 +213,11 @@ clean_application_support_logs() {
|
|||||||
app_name=$(basename "$app_dir")
|
app_name=$(basename "$app_dir")
|
||||||
|
|
||||||
# Skip system and protected apps
|
# Skip system and protected apps
|
||||||
case "$app_name" in
|
# Convert to lowercase for case-insensitive matching
|
||||||
com.apple.* | Adobe* | JetBrains* | 1Password | Claude | *ClashX* | *clash* | mihomo* | *Surge* | iTerm* | *iterm* | Warp* | Kitty* | Alacritty* | WezTerm* | Ghostty*)
|
local app_name_lower
|
||||||
|
app_name_lower=$(echo "$app_name" | tr '[:upper:]' '[:lower:]')
|
||||||
|
case "$app_name_lower" in
|
||||||
|
com.apple.* | adobe* | jetbrains* | 1password | claude | *clashx* | *clash* | mihomo* | *surge* | iterm* | warp* | kitty* | alacritty* | wezterm* | ghostty*)
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -98,13 +98,17 @@ readonly STAT_BSD="/usr/bin/stat"
|
|||||||
# Get file size in bytes using BSD stat
|
# Get file size in bytes using BSD stat
|
||||||
get_file_size() {
|
get_file_size() {
|
||||||
local file="$1"
|
local file="$1"
|
||||||
$STAT_BSD -f%z "$file" 2> /dev/null || echo 0
|
local result
|
||||||
|
result=$($STAT_BSD -f%z "$file" 2> /dev/null)
|
||||||
|
echo "${result:-0}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get file modification time (epoch seconds) using BSD stat
|
# Get file modification time (epoch seconds) using BSD stat
|
||||||
get_file_mtime() {
|
get_file_mtime() {
|
||||||
local file="$1"
|
local file="$1"
|
||||||
$STAT_BSD -f%m "$file" 2> /dev/null || echo 0
|
local result
|
||||||
|
result=$($STAT_BSD -f%m "$file" 2> /dev/null)
|
||||||
|
echo "${result:-0}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get file owner username using BSD stat
|
# Get file owner username using BSD stat
|
||||||
@@ -1145,7 +1149,9 @@ clean_tool_cache() {
|
|||||||
# Returns: size in KB, or 0 if path doesn't exist or error occurs
|
# Returns: size in KB, or 0 if path doesn't exist or error occurs
|
||||||
get_path_size_kb() {
|
get_path_size_kb() {
|
||||||
local path="$1"
|
local path="$1"
|
||||||
du -sk "$path" 2> /dev/null | awk '{print $1}' || echo "0"
|
local result
|
||||||
|
result=$(du -sk "$path" 2> /dev/null | awk '{print $1}')
|
||||||
|
echo "${result:-0}"
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes_to_human_kb() { bytes_to_human "$((${1:-0} * 1024))"; }
|
bytes_to_human_kb() { bytes_to_human "$((${1:-0} * 1024))"; }
|
||||||
|
|||||||
2
mole
2
mole
@@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "$SCRIPT_DIR/lib/core/common.sh"
|
source "$SCRIPT_DIR/lib/core/common.sh"
|
||||||
|
|
||||||
# Version info
|
# Version info
|
||||||
VERSION="1.11.15"
|
VERSION="1.11.16"
|
||||||
MOLE_TAGLINE="can dig deep to clean your Mac."
|
MOLE_TAGLINE="can dig deep to clean your Mac."
|
||||||
|
|
||||||
# Check if Touch ID is already configured
|
# Check if Touch ID is already configured
|
||||||
|
|||||||
Reference in New Issue
Block a user