mirror of
https://github.com/tw93/Mole.git
synced 2026-02-16 02:36:12 +00:00
Fix the problem of password input error and re-entry
This commit is contained in:
19
bin/clean.sh
19
bin/clean.sh
@@ -23,25 +23,6 @@ readonly MAX_PARALLEL_JOBS=15 # Maximum parallel background jobs
|
|||||||
readonly TEMP_FILE_AGE_DAYS=7 # Age threshold for temp file cleanup
|
readonly TEMP_FILE_AGE_DAYS=7 # Age threshold for temp file cleanup
|
||||||
readonly ORPHAN_AGE_DAYS=60 # Age threshold for orphaned data
|
readonly ORPHAN_AGE_DAYS=60 # Age threshold for orphaned data
|
||||||
|
|
||||||
# Timeout helper (GNU timeout isn't available on stock macOS)
|
|
||||||
TIMEOUT_BIN=""
|
|
||||||
for candidate in gtimeout timeout; do
|
|
||||||
if command -v "$candidate" > /dev/null 2>&1; then
|
|
||||||
TIMEOUT_BIN="$candidate"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
run_with_timeout() {
|
|
||||||
local duration="$1"
|
|
||||||
shift
|
|
||||||
if [[ -n "$TIMEOUT_BIN" ]]; then
|
|
||||||
"$TIMEOUT_BIN" "$duration" "$@"
|
|
||||||
else
|
|
||||||
"$@"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Protected Service Worker domains (web-based editing tools)
|
# Protected Service Worker domains (web-based editing tools)
|
||||||
readonly PROTECTED_SW_DOMAINS=(
|
readonly PROTECTED_SW_DOMAINS=(
|
||||||
"capcut.com"
|
"capcut.com"
|
||||||
|
|||||||
17
mole
17
mole
@@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "$SCRIPT_DIR/lib/common.sh"
|
source "$SCRIPT_DIR/lib/common.sh"
|
||||||
|
|
||||||
# Version info
|
# Version info
|
||||||
VERSION="1.10.12"
|
VERSION="1.10.13"
|
||||||
MOLE_TAGLINE="can dig deep to clean your Mac."
|
MOLE_TAGLINE="can dig deep to clean your Mac."
|
||||||
|
|
||||||
# Check if Touch ID is already configured
|
# Check if Touch ID is already configured
|
||||||
@@ -274,6 +274,21 @@ update_mole() {
|
|||||||
local install_dir
|
local install_dir
|
||||||
install_dir="$(cd "$(dirname "$mole_path")" && pwd)"
|
install_dir="$(cd "$(dirname "$mole_path")" && pwd)"
|
||||||
|
|
||||||
|
local requires_sudo="false"
|
||||||
|
if [[ ! -w "$install_dir" ]]; then
|
||||||
|
requires_sudo="true"
|
||||||
|
elif [[ -e "$install_dir/mole" && ! -w "$install_dir/mole" ]]; then
|
||||||
|
requires_sudo="true"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$requires_sudo" == "true" ]]; then
|
||||||
|
if ! request_sudo_access "Mole update requires admin access"; then
|
||||||
|
log_error "Update aborted (admin access denied)"
|
||||||
|
rm -f "$tmp_installer"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -t 1 ]]; then
|
if [[ -t 1 ]]; then
|
||||||
start_inline_spinner "Installing update..."
|
start_inline_spinner "Installing update..."
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user