1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 16:49:41 +00:00

feat: add new system optimization tasks and implement orphaned startup item cleanup

This commit is contained in:
Tw93
2025-12-29 19:06:04 +08:00
parent 7af6b39875
commit 44e91be007
9 changed files with 682 additions and 185 deletions

View File

@@ -193,22 +193,6 @@ ensure_directory() {
ensure_user_dir "$expanded_path"
}
count_local_snapshots() {
if ! command -v tmutil > /dev/null 2>&1; then
echo 0
return
fi
local output
output=$(tmutil listlocalsnapshots / 2> /dev/null || true)
if [[ -z "$output" ]]; then
echo 0
return
fi
echo "$output" | grep -c "com.apple.TimeMachine." | tr -d ' '
}
declare -a SECURITY_FIXES=()
collect_security_fix_actions() {
@@ -224,7 +208,7 @@ collect_security_fix_actions() {
fi
fi
if touchid_supported && ! touchid_configured; then
if ! is_whitelisted "touchid"; then
if ! is_whitelisted "check_touchid"; then
SECURITY_FIXES+=("touchid|Enable Touch ID for sudo")
fi
fi
@@ -424,7 +408,7 @@ main() {
done < "$opts_file"
echo ""
ensure_sudo_session "System optimization requires admin access (Touch ID or password)" || true
ensure_sudo_session "System optimization requires admin access" || true
export FIRST_ACTION=true
if [[ ${#safe_items[@]} -gt 0 ]]; then