Skip to content

Commit 2578d0a

Browse files
committed
chore: Bump version to 1.29.0
1 parent 9fea75a commit 2578d0a

File tree

3 files changed

+16
-236
lines changed

3 files changed

+16
-236
lines changed

RELEASE_TEST_CHECKLIST.md

Lines changed: 0 additions & 223 deletions
This file was deleted.

lib/clean/user.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,8 +859,8 @@ clean_application_support_logs() {
859859
if [[ -d "$candidate" ]]; then
860860
# Quick count check - skip if too many items to avoid hanging
861861
local quick_count
862-
quick_count=$(command find "$candidate" -mindepth 1 -maxdepth 1 -print0 2> /dev/null | tr -d '\0' | wc -c)
863-
if [[ "$quick_count" -gt 5000 ]]; then
862+
quick_count=$(command find "$candidate" -mindepth 1 -maxdepth 1 -printf '1\n' 2> /dev/null | wc -l | tr -d ' ')
863+
if [[ "$quick_count" -gt 100 ]]; then
864864
# Too many items - use bulk removal instead of item-by-item
865865
local app_label="$app_name"
866866
if [[ ${#app_label} -gt 24 ]]; then
@@ -935,8 +935,8 @@ clean_application_support_logs() {
935935
if [[ -d "$candidate" ]]; then
936936
# Quick count check - skip if too many items
937937
local quick_count
938-
quick_count=$(command find "$candidate" -mindepth 1 -maxdepth 1 -print0 2> /dev/null | tr -d '\0' | wc -c)
939-
if [[ "$quick_count" -gt 5000 ]]; then
938+
quick_count=$(command find "$candidate" -mindepth 1 -maxdepth 1 -printf '1\n' 2> /dev/null | wc -l | tr -d ' ')
939+
if [[ "$quick_count" -gt 100 ]]; then
940940
local container_label="$container"
941941
if [[ ${#container_label} -gt 24 ]]; then
942942
container_label="${container_label:0:21}..."

mole

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ source "$SCRIPT_DIR/lib/core/commands.sh"
1313
trap cleanup_temp_files EXIT INT TERM
1414

1515
# Version and update helpers
16-
VERSION="1.28.1"
16+
VERSION="1.29.0"
1717
MOLE_TAGLINE="Deep clean and optimize your Mac."
1818

1919
is_touchid_configured() {
@@ -37,6 +37,14 @@ get_latest_version_from_github() {
3737
echo "$version"
3838
}
3939

40+
# Check if mole exists in a brew formula list string.
41+
# Args: $1 - brew_list output string
42+
# Returns 0 if "mole" appears as a whole line, 1 otherwise.
43+
_mole_in_brew_list() {
44+
local list="$1"
45+
[[ -n "$list" ]] && [[ $'\n'"$list"$'\n' == *$'\n'"mole"$'\n'* ]]
46+
}
47+
4048
# Install detection (Homebrew vs manual).
4149
# Uses variable capture + string matching to avoid SIGPIPE under pipefail.
4250
is_homebrew_install() {
@@ -49,15 +57,10 @@ is_homebrew_install() {
4957
brew_list=$(brew list --formula 2> /dev/null) || true
5058
fi
5159

52-
# Helper to check if mole is in brew list
53-
_mole_in_brew_list() {
54-
[[ -n "$brew_list" ]] && [[ $'\n'"$brew_list"$'\n' == *$'\n'"mole"$'\n'* ]]
55-
}
56-
5760
if [[ -L "$mole_path" ]]; then
5861
link_target=$(readlink "$mole_path" 2> /dev/null) || true
5962
if [[ "$link_target" == *"Cellar/mole"* ]]; then
60-
$has_brew && _mole_in_brew_list && return 0
63+
$has_brew && _mole_in_brew_list "$brew_list" && return 0
6164
return 1
6265
fi
6366
fi
@@ -67,7 +70,7 @@ is_homebrew_install() {
6770
/opt/homebrew/bin/mole | /usr/local/bin/mole)
6871
if [[ -d /opt/homebrew/Cellar/mole ]] || [[ -d /usr/local/Cellar/mole ]]; then
6972
if $has_brew; then
70-
_mole_in_brew_list && return 0
73+
_mole_in_brew_list "$brew_list" && return 0
7174
else
7275
return 0 # Cellar exists, probably Homebrew install
7376
fi
@@ -80,7 +83,7 @@ is_homebrew_install() {
8083
local brew_prefix
8184
brew_prefix=$(brew --prefix 2> /dev/null)
8285
if [[ -n "$brew_prefix" && "$mole_path" == "$brew_prefix/bin/mole" && -d "$brew_prefix/Cellar/mole" ]]; then
83-
_mole_in_brew_list && return 0
86+
_mole_in_brew_list "$brew_list" && return 0
8487
fi
8588
fi
8689

0 commit comments

Comments
 (0)