Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Clean up all previous finch version installation registries in postinstall and uninstall #688

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion installer-builder/darwin/Resources/uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ if [ "$$(readlink "/usr/local/bin/finch")" = "/Applications/Finch/bin/finch" ];
echo "[1/3] [DONE] Successfully deleted shortcut links"

#forget from pkgutil
pkgutil --forget "org.Finch.__VERSION__" > /dev/null 2>&1
echo "Remove historical pkgutil packages..."
pkgutil --pkgs | grep '^org\.Finch\.' | while read -r pkg; do
echo "Forgetting package $pkg"
sudo pkgutil --forget "$pkg" > /dev/null 2>&1
done

if [ $? -eq 0 ]
then
echo "[2/3] [DONE] Successfully deleted application informations"
Expand Down
7 changes: 7 additions & 0 deletions installer-builder/darwin/scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ sudo rm -rf "/opt/finch/"
sudo rm -rf "/private/var/run/finch-lima"
sudo rm -rf "/private/etc/sudoers.d/finch-lima"

# Forget previous pkgutil packages starting with org.Finch except for the current version
echo "Remove historical pkgutil packages..."
KevinLiAWS marked this conversation as resolved.
Show resolved Hide resolved
pkgutil --pkgs | grep '^org\.Finch\.' | grep -v '^org\.Finch\.__VERSION__' | while read -r pkg; do
echo "Forgetting package $pkg"
sudo pkgutil --forget "$pkg"
done

echo "Post installation process finished."
Loading