mirror of
https://github.com/tw93/Mole.git
synced 2026-02-12 23:15:15 +00:00
fix(uninstall): detect Zed HTTPStorages channel variants (#422)
This commit is contained in:
@@ -997,6 +997,14 @@ find_app_files() {
|
|||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Issue #422: Zed channel builds can leave data under another channel bundle id.
|
||||||
|
# Example: uninstalling dev.zed.Zed-Nightly should also detect dev.zed.Zed-Preview leftovers.
|
||||||
|
if [[ "$bundle_id" =~ ^dev\.zed\.Zed- ]] && [[ -d "$HOME/Library/HTTPStorages" ]]; then
|
||||||
|
while IFS= read -r -d '' zed_http_storage; do
|
||||||
|
files_to_clean+=("$zed_http_storage")
|
||||||
|
done < <(command find "$HOME/Library/HTTPStorages" -maxdepth 1 -name "dev.zed.Zed-*" -print0 2> /dev/null)
|
||||||
|
fi
|
||||||
|
|
||||||
# Process standard patterns
|
# Process standard patterns
|
||||||
for p in "${user_patterns[@]}"; do
|
for p in "${user_patterns[@]}"; do
|
||||||
local expanded_path="${p/#\~/$HOME}"
|
local expanded_path="${p/#\~/$HOME}"
|
||||||
|
|||||||
@@ -60,6 +60,18 @@ setup() {
|
|||||||
[[ "$result" =~ "Library/Application Support/Zed" ]]
|
[[ "$result" =~ "Library/Application Support/Zed" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "find_app_files detects Zed channel variants in HTTPStorages only" {
|
||||||
|
mkdir -p "$HOME/Library/HTTPStorages/dev.zed.Zed-Preview"
|
||||||
|
mkdir -p "$HOME/Library/Application Support/Firefox/Profiles/default/storage/default/https+++zed.dev"
|
||||||
|
echo "test" > "$HOME/Library/HTTPStorages/dev.zed.Zed-Preview/data"
|
||||||
|
echo "test" > "$HOME/Library/Application Support/Firefox/Profiles/default/storage/default/https+++zed.dev/data"
|
||||||
|
|
||||||
|
result=$(find_app_files "dev.zed.Zed-Nightly" "Zed Nightly")
|
||||||
|
|
||||||
|
[[ "$result" =~ "Library/HTTPStorages/dev.zed.Zed-Preview" ]]
|
||||||
|
[[ ! "$result" =~ "storage/default/https\+\+\+zed\.dev" ]]
|
||||||
|
}
|
||||||
|
|
||||||
@test "find_app_files detects multiple naming variants simultaneously" {
|
@test "find_app_files detects multiple naming variants simultaneously" {
|
||||||
mkdir -p "$HOME/.config/maestro-studio"
|
mkdir -p "$HOME/.config/maestro-studio"
|
||||||
mkdir -p "$HOME/Library/Application Support/MaestroStudio"
|
mkdir -p "$HOME/Library/Application Support/MaestroStudio"
|
||||||
|
|||||||
Reference in New Issue
Block a user