mirror of
https://github.com/tw93/Mole.git
synced 2026-02-10 09:39:18 +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")
|
||||
|
||||
# Skip system and protected apps
|
||||
case "$app_name" in
|
||||
com.apple.* | Adobe* | JetBrains* | 1Password | Claude | *ClashX* | *clash* | mihomo* | *Surge* | iTerm* | *iterm* | Warp* | Kitty* | Alacritty* | WezTerm* | Ghostty*)
|
||||
# Convert to lowercase for case-insensitive matching
|
||||
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
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -98,13 +98,17 @@ readonly STAT_BSD="/usr/bin/stat"
|
||||
# Get file size in bytes using BSD stat
|
||||
get_file_size() {
|
||||
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_mtime() {
|
||||
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
|
||||
@@ -1145,7 +1149,9 @@ clean_tool_cache() {
|
||||
# Returns: size in KB, or 0 if path doesn't exist or error occurs
|
||||
get_path_size_kb() {
|
||||
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))"; }
|
||||
|
||||
Reference in New Issue
Block a user