1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 14:26:46 +00:00

refactor: Improve shell array expansion robustness in cleanup functions

This commit is contained in:
Tw93
2025-12-23 09:55:18 +08:00
parent 275458bd86
commit 6d66465447
2 changed files with 6 additions and 6 deletions

View File

@@ -413,11 +413,11 @@ clean_project_artifacts() {
# shellcheck disable=SC2329
cleanup_scan() {
# Kill all background scans
for pid in "${scan_pids[@]}"; do
for pid in "${scan_pids[@]+"${scan_pids[@]}"}"; do
kill "$pid" 2> /dev/null || true
done
# Clean up temp files
for temp in "${scan_temps[@]}"; do
for temp in "${scan_temps[@]+"${scan_temps[@]}"}"; do
rm -f "$temp" 2> /dev/null || true
done
if [[ -t 1 ]]; then
@@ -450,7 +450,7 @@ clean_project_artifacts() {
done
# Wait for all scans to complete
for pid in "${scan_pids[@]}"; do
for pid in "${scan_pids[@]+"${scan_pids[@]}"}"; do
wait "$pid" 2> /dev/null || true
done
@@ -459,7 +459,7 @@ clean_project_artifacts() {
fi
# Collect all results
for scan_output in "${scan_temps[@]}"; do
for scan_output in "${scan_temps[@]+"${scan_temps[@]}"}"; do
if [[ -f "$scan_output" ]]; then
while IFS= read -r item; do
if [[ -n "$item" ]]; then
@@ -564,7 +564,7 @@ clean_project_artifacts() {
# Check if recent
local is_recent=false
for recent_item in "${recently_modified[@]}"; do
for recent_item in "${recently_modified[@]+"${recently_modified[@]}"}"; do
if [[ "$item" == "$recent_item" ]]; then
is_recent=true
break

2
mole
View File

@@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/lib/core/common.sh"
# Version info
VERSION="1.14.2"
VERSION="1.14.3"
MOLE_TAGLINE="Deep clean and optimize your Mac."
# Check TouchID configuration