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

add AI agent documentation, improve Touch ID testing, and update version.

This commit is contained in:
Tw93
2025-12-12 15:31:23 +08:00
parent 4ff20ff4e5
commit 1896ddd348
12 changed files with 193 additions and 15 deletions

View File

@@ -411,7 +411,7 @@ EOF
}
@test "get_path_size_kb returns zero for missing directory" {
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" bash --noprofile --norc << 'EOF'
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" MO_DEBUG=0 bash --noprofile --norc << 'EOF'
set -euo pipefail
source "$PROJECT_ROOT/lib/core/common.sh"
size=$(get_path_size_kb "/nonexistent/path")
@@ -426,7 +426,7 @@ EOF
mkdir -p "$HOME/test_size"
dd if=/dev/zero of="$HOME/test_size/file.dat" bs=1024 count=10 2>/dev/null
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" bash --noprofile --norc << 'EOF'
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" MO_DEBUG=0 bash --noprofile --norc << 'EOF'
set -euo pipefail
source "$PROJECT_ROOT/lib/core/common.sh"
size=$(get_path_size_kb "$HOME/test_size")

View File

@@ -0,0 +1,34 @@
# Mole Cleanup Preview - 2025-12-12 15:31:00
#
# How to protect files:
# 1. Copy any path below to ~/.config/mole/whitelist
# 2. Run: mo clean --whitelist
#
# Example:
# /Users/*/Library/Caches/com.example.app
#
=== User essentials ===
=== Finder metadata ===
=== macOS system caches ===
=== Sandboxed app caches ===
=== Browsers ===
=== Cloud storage ===
=== Office applications ===
=== Developer tools ===
=== Development applications ===
=== Virtual machine tools ===
=== Application Support ===
=== Uninstalled app data ===

View File

@@ -0,0 +1 @@
dependency

View File

@@ -20,9 +20,11 @@ teardown_file() {
fi
}
create_fake_sudo() {
create_fake_utils() {
local dir="$1"
mkdir -p "$dir"
# Fake sudo
cat > "$dir/sudo" <<'SCRIPT'
#!/usr/bin/env bash
if [[ "$1" == "-n" || "$1" == "-v" ]]; then
@@ -31,6 +33,17 @@ fi
exec "$@"
SCRIPT
chmod +x "$dir/sudo"
# Fake bioutil
cat > "$dir/bioutil" <<'SCRIPT'
#!/usr/bin/env bash
if [[ "$1" == "-r" ]]; then
echo "Touch ID: 1"
exit 0
fi
exit 0
SCRIPT
chmod +x "$dir/bioutil"
}
@test "touchid status reflects pam file contents" {
@@ -61,7 +74,7 @@ auth sufficient pam_opendirectory.so
EOF
fake_bin="$HOME/fake-bin"
create_fake_sudo "$fake_bin"
create_fake_utils "$fake_bin"
run env PATH="$fake_bin:$PATH" MOLE_PAM_SUDO_FILE="$pam_file" "$PROJECT_ROOT/bin/touchid.sh" enable
[ "$status" -eq 0 ]
@@ -77,7 +90,7 @@ auth sufficient pam_opendirectory.so
EOF
fake_bin="$HOME/fake-bin-disable"
create_fake_sudo "$fake_bin"
create_fake_utils "$fake_bin"
run env PATH="$fake_bin:$PATH" MOLE_PAM_SUDO_FILE="$pam_file" "$PROJECT_ROOT/bin/touchid.sh" disable
[ "$status" -eq 0 ]