mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 16:49:41 +00:00
Improve spinner subprocess and trap cleanup handling
This commit is contained in:
@@ -10,8 +10,6 @@ export LANG=C
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../lib/core/common.sh"
|
||||
|
||||
# Set up cleanup trap for temporary files
|
||||
trap cleanup_temp_files EXIT INT TERM
|
||||
source "$SCRIPT_DIR/../lib/core/sudo.sh"
|
||||
source "$SCRIPT_DIR/../lib/clean/brew.sh"
|
||||
source "$SCRIPT_DIR/../lib/clean/caches.sh"
|
||||
@@ -137,6 +135,9 @@ cleanup() {
|
||||
printf "\r\033[K" >&2
|
||||
fi
|
||||
|
||||
# Clean up temporary files
|
||||
cleanup_temp_files
|
||||
|
||||
# Stop sudo session
|
||||
stop_sudo_session
|
||||
|
||||
|
||||
@@ -240,7 +240,8 @@ scan_applications() {
|
||||
|
||||
local spinner_pid=""
|
||||
(
|
||||
trap 'exit 0' TERM INT EXIT
|
||||
cleanup_spinner() { exit 0; }
|
||||
trap cleanup_spinner TERM INT EXIT
|
||||
local spinner_chars="|/-\\"
|
||||
local i=0
|
||||
while true; do
|
||||
|
||||
@@ -259,7 +259,8 @@ scan_applications() {
|
||||
# Start a background spinner that reads progress from file
|
||||
local spinner_pid=""
|
||||
(
|
||||
trap 'exit 0' TERM INT EXIT
|
||||
cleanup_spinner() { exit 0; }
|
||||
trap cleanup_spinner TERM INT EXIT
|
||||
local spinner_chars="|/-\\"
|
||||
local i=0
|
||||
while true; do
|
||||
|
||||
Reference in New Issue
Block a user