mirror of
https://github.com/tw93/Mole.git
synced 2026-02-16 10:06:10 +00:00
refactor: Improve shell array expansion robustness in cleanup functions
This commit is contained in:
@@ -413,11 +413,11 @@ clean_project_artifacts() {
|
|||||||
# shellcheck disable=SC2329
|
# shellcheck disable=SC2329
|
||||||
cleanup_scan() {
|
cleanup_scan() {
|
||||||
# Kill all background scans
|
# Kill all background scans
|
||||||
for pid in "${scan_pids[@]}"; do
|
for pid in "${scan_pids[@]+"${scan_pids[@]}"}"; do
|
||||||
kill "$pid" 2> /dev/null || true
|
kill "$pid" 2> /dev/null || true
|
||||||
done
|
done
|
||||||
# Clean up temp files
|
# 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
|
rm -f "$temp" 2> /dev/null || true
|
||||||
done
|
done
|
||||||
if [[ -t 1 ]]; then
|
if [[ -t 1 ]]; then
|
||||||
@@ -450,7 +450,7 @@ clean_project_artifacts() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Wait for all scans to complete
|
# 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
|
wait "$pid" 2> /dev/null || true
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -459,7 +459,7 @@ clean_project_artifacts() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Collect all results
|
# Collect all results
|
||||||
for scan_output in "${scan_temps[@]}"; do
|
for scan_output in "${scan_temps[@]+"${scan_temps[@]}"}"; do
|
||||||
if [[ -f "$scan_output" ]]; then
|
if [[ -f "$scan_output" ]]; then
|
||||||
while IFS= read -r item; do
|
while IFS= read -r item; do
|
||||||
if [[ -n "$item" ]]; then
|
if [[ -n "$item" ]]; then
|
||||||
@@ -564,7 +564,7 @@ clean_project_artifacts() {
|
|||||||
|
|
||||||
# Check if recent
|
# Check if recent
|
||||||
local is_recent=false
|
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
|
if [[ "$item" == "$recent_item" ]]; then
|
||||||
is_recent=true
|
is_recent=true
|
||||||
break
|
break
|
||||||
|
|||||||
2
mole
2
mole
@@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "$SCRIPT_DIR/lib/core/common.sh"
|
source "$SCRIPT_DIR/lib/core/common.sh"
|
||||||
|
|
||||||
# Version info
|
# Version info
|
||||||
VERSION="1.14.2"
|
VERSION="1.14.3"
|
||||||
MOLE_TAGLINE="Deep clean and optimize your Mac."
|
MOLE_TAGLINE="Deep clean and optimize your Mac."
|
||||||
|
|
||||||
# Check TouchID configuration
|
# Check TouchID configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user