mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 20:25:04 +00:00
format
This commit is contained in:
@@ -90,5 +90,4 @@ main() {
|
|||||||
printf '\n'
|
printf '\n'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ show_optimization_summary() {
|
|||||||
print_summary_block "success" "$summary_title" "${summary_details[@]}"
|
print_summary_block "success" "$summary_title" "${summary_details[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
show_system_health() {
|
show_system_health() {
|
||||||
local health_json="$1"
|
local health_json="$1"
|
||||||
|
|
||||||
@@ -315,7 +314,6 @@ perform_security_fixes() {
|
|||||||
SECURITY_FIXES=()
|
SECURITY_FIXES=()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cleanup_all() {
|
cleanup_all() {
|
||||||
stop_sudo_session
|
stop_sudo_session
|
||||||
cleanup_temp_files
|
cleanup_temp_files
|
||||||
|
|||||||
@@ -532,9 +532,9 @@ is_clamshell_mode() {
|
|||||||
|
|
||||||
# Check if lid is closed; ignore pipeline failures so set -e doesn't exit
|
# Check if lid is closed; ignore pipeline failures so set -e doesn't exit
|
||||||
local clamshell_state=""
|
local clamshell_state=""
|
||||||
clamshell_state=$( (ioreg -r -k AppleClamshellState -d 4 2>/dev/null \
|
clamshell_state=$( (ioreg -r -k AppleClamshellState -d 4 2> /dev/null |
|
||||||
| grep "AppleClamshellState" \
|
grep "AppleClamshellState" |
|
||||||
| head -1) || true )
|
head -1) || true)
|
||||||
|
|
||||||
if [[ "$clamshell_state" =~ \"AppleClamshellState\"\ =\ Yes ]]; then
|
if [[ "$clamshell_state" =~ \"AppleClamshellState\"\ =\ Yes ]]; then
|
||||||
return 0 # Lid is closed
|
return 0 # Lid is closed
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ readonly MAIL_DOWNLOADS_MIN_KB=5120 # ~5MB threshold
|
|||||||
|
|
||||||
_opt_get_dir_size_kb() {
|
_opt_get_dir_size_kb() {
|
||||||
local path="$1"
|
local path="$1"
|
||||||
[[ -e "$path" ]] || { echo 0; return; }
|
[[ -e "$path" ]] || {
|
||||||
|
echo 0
|
||||||
|
return
|
||||||
|
}
|
||||||
du -sk "$path" 2> /dev/null | awk '{print $1}' || echo 0
|
du -sk "$path" 2> /dev/null | awk '{print $1}' || echo 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,10 @@ format_brew_update_label() {
|
|||||||
|
|
||||||
local detail_str="(${total} updates)"
|
local detail_str="(${total} updates)"
|
||||||
if ((${#details[@]} > 0)); then
|
if ((${#details[@]} > 0)); then
|
||||||
detail_str="($(IFS=', '; printf '%s' "${details[*]}"))"
|
detail_str="($(
|
||||||
|
IFS=', '
|
||||||
|
printf '%s' "${details[*]}"
|
||||||
|
))"
|
||||||
fi
|
fi
|
||||||
printf " • Homebrew %s" "$detail_str"
|
printf " • Homebrew %s" "$detail_str"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,9 +108,11 @@ setup() {
|
|||||||
|
|
||||||
run bash --noprofile --norc -c "cd '$PROJECT_ROOT'; printf \$' \\n' | HOME='$HOME' ./mo clean --whitelist"
|
run bash --noprofile --norc -c "cd '$PROJECT_ROOT'; printf \$' \\n' | HOME='$HOME' ./mo clean --whitelist"
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
! grep -q "\\.m2/repository" "$whitelist_file"
|
run grep -q "\\.m2/repository" "$whitelist_file"
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
|
||||||
run bash --noprofile --norc -c "cd '$PROJECT_ROOT'; printf \$'\\n' | HOME='$HOME' ./mo clean --whitelist"
|
run bash --noprofile --norc -c "cd '$PROJECT_ROOT'; printf \$'\\n' | HOME='$HOME' ./mo clean --whitelist"
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
! grep -q "\\.m2/repository" "$whitelist_file"
|
run grep -q "\\.m2/repository" "$whitelist_file"
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user