1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 18:30:08 +00:00

Merge branch 'bugfix/fix-software-update-available-false-positive'

# Conflicts:
#	lib/check/all.sh
#	tests/clean_system_maintenance.bats
This commit is contained in:
Tw93
2026-03-18 14:58:37 +08:00
2 changed files with 36 additions and 31 deletions

View File

@@ -227,37 +227,42 @@ fi
echo "" echo ""
echo "6. Testing installation..." echo "6. Testing installation..."
# Skip if Homebrew mole is installed (install.sh will refuse to overwrite) # Installation script is macOS-specific; skip this test on non-macOS platforms
install_test_home="" if [[ "$(uname -s)" != "Darwin" ]]; then
if command -v brew > /dev/null 2>&1 && brew list mole &> /dev/null; then printf "${YELLOW}${ICON_WARNING} Installation test skipped (non-macOS)${NC}\n"
printf "${GREEN}${ICON_SUCCESS} Installation test skipped, Homebrew${NC}\n"
else else
install_test_home="$(mktemp -d /tmp/mole-test-home.XXXXXX 2> /dev/null || true)" # Skip if Homebrew mole is installed (install.sh will refuse to overwrite)
if [[ -z "$install_test_home" ]]; then install_test_home=""
install_test_home="/tmp/mole-test-home" if command -v brew > /dev/null 2>&1 && brew list mole &> /dev/null; then
mkdir -p "$install_test_home" printf "${GREEN}${ICON_SUCCESS} Installation test skipped, Homebrew${NC}\n"
else
install_test_home="$(mktemp -d /tmp/mole-test-home.XXXXXX 2> /dev/null || true)"
if [[ -z "$install_test_home" ]]; then
install_test_home="/tmp/mole-test-home"
mkdir -p "$install_test_home"
fi
fi fi
fi if [[ -z "$install_test_home" ]]; then
if [[ -z "$install_test_home" ]]; then :
: elif HOME="$install_test_home" \
elif HOME="$install_test_home" \ XDG_CONFIG_HOME="$install_test_home/.config" \
XDG_CONFIG_HOME="$install_test_home/.config" \ XDG_CACHE_HOME="$install_test_home/.cache" \
XDG_CACHE_HOME="$install_test_home/.cache" \ MO_NO_OPLOG=1 \
MO_NO_OPLOG=1 \ ./install.sh --prefix /tmp/mole-test > /dev/null 2>&1; then
./install.sh --prefix /tmp/mole-test > /dev/null 2>&1; then if [[ -f "/tmp/mole-test/mole" ]]; then
if [ -f /tmp/mole-test/mole ]; then printf "${GREEN}${ICON_SUCCESS} Installation test passed${NC}\n"
printf "${GREEN}${ICON_SUCCESS} Installation test passed${NC}\n" else
printf "${RED}${ICON_ERROR} Installation test failed${NC}\n"
((FAILED++))
fi
else else
printf "${RED}${ICON_ERROR} Installation test failed${NC}\n" printf "${RED}${ICON_ERROR} Installation test failed${NC}\n"
((FAILED++)) ((FAILED++))
fi fi
else MO_NO_OPLOG=1 safe_remove "/tmp/mole-test" true || true
printf "${RED}${ICON_ERROR} Installation test failed${NC}\n" if [[ -n "$install_test_home" ]]; then
((FAILED++)) MO_NO_OPLOG=1 safe_remove "$install_test_home" true || true
fi fi
MO_NO_OPLOG=1 safe_remove "/tmp/mole-test" true || true
if [[ -n "$install_test_home" ]]; then
MO_NO_OPLOG=1 safe_remove "$install_test_home" true || true
fi fi
echo "" echo ""

View File

@@ -119,12 +119,12 @@ setup() {
result=$(find_app_files "com.tencent.xinWeChat" "WeChat") result=$(find_app_files "com.tencent.xinWeChat" "WeChat")
[[ "$result" =~ "Library/Application Support/FileProvider/com.tencent.xinWeChat.WeChatFileProviderExtension" ]] [[ "$result" =~ Library/Application\ Support/FileProvider/com.tencent.xinWeChat.WeChatFileProviderExtension ]]
[[ "$result" =~ "Library/Application Scripts/com.tencent.xinWeChat.WeChatMacShare" ]] [[ "$result" =~ Library/Application\ Scripts/com.tencent.xinWeChat.WeChatMacShare ]]
[[ "$result" =~ "Library/Application Scripts/5A4RE8SF68.com.tencent.xinWeChat" ]] [[ "$result" =~ Library/Application\ Scripts/5A4RE8SF68.com.tencent.xinWeChat ]]
[[ "$result" =~ "Library/Containers/com.tencent.xinWeChat.WeChatFileProviderExtension" ]] [[ "$result" =~ Library/Containers/com.tencent.xinWeChat.WeChatFileProviderExtension ]]
[[ "$result" =~ "Library/Group Containers/5A4RE8SF68.com.tencent.xinWeChat" ]] [[ "$result" =~ Library/Group\ Containers/5A4RE8SF68.com.tencent.xinWeChat ]]
[[ ! "$result" =~ "Library/Containers/com.tencent.otherapp.Helper" ]] [[ ! "$result" =~ Library/Containers/com.tencent.otherapp.Helper ]]
} }
@test "find_app_files does not match empty app name" { @test "find_app_files does not match empty app name" {