summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEric Knibbe <enk3@outlook.com>2025-06-06 15:53:53 -0400
committerMarkus Pettersson <markus.pettersson@mullvad.net>2025-06-19 16:32:07 +0200
commit875d18bfbcee198fe162673ca454e71cc98ac0b9 (patch)
treef6def9b228d23ea82274e1f0a30bc127a8bb9bcb
parent9f2acb70e2677cd8c3f7eeda56dec56c07f65ad4 (diff)
downloadmullvadvpn-875d18bfbcee198fe162673ca454e71cc98ac0b9.tar.xz
mullvadvpn-875d18bfbcee198fe162673ca454e71cc98ac0b9.zip
macOS: use `/opt/homebrew` for zsh completions if available
-rw-r--r--CHANGELOG.md1
-rwxr-xr-xdist-assets/pkg-scripts/postinstall6
-rwxr-xr-xdist-assets/uninstall_macos.sh4
3 files changed, 8 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1cba056475..1f02e8f16c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -33,6 +33,7 @@ Line wrap the file at 100 chars. Th
### Changed
#### macOS
- Use a local DNS resolver on the 127.0.0.0/8 network, regardless of macOS version.
+- Install zsh completions in `/opt/homebrew` if available.
### Fixed
#### macOS
diff --git a/dist-assets/pkg-scripts/postinstall b/dist-assets/pkg-scripts/postinstall
index 6f6f6f9904..2c067efab1 100755
--- a/dist-assets/pkg-scripts/postinstall
+++ b/dist-assets/pkg-scripts/postinstall
@@ -62,7 +62,11 @@ DAEMON_PLIST=$(cat <<-EOM
EOM
)
-ZSH_COMPLETIONS_DIR="/usr/local/share/zsh/site-functions/"
+if [[ -d "/opt/homebrew/share/zsh/site-functions/" ]]; then
+ ZSH_COMPLETIONS_DIR="/opt/homebrew/share/zsh/site-functions/"
+else
+ ZSH_COMPLETIONS_DIR="/usr/local/share/zsh/site-functions/"
+fi
if [[ -d "/opt/homebrew/share/fish/vendor_completions.d/" ]]; then
FISH_COMPLETIONS_DIR="/opt/homebrew/share/fish/vendor_completions.d/"
diff --git a/dist-assets/uninstall_macos.sh b/dist-assets/uninstall_macos.sh
index 0983ee43ae..085885f836 100755
--- a/dist-assets/uninstall_macos.sh
+++ b/dist-assets/uninstall_macos.sh
@@ -36,10 +36,10 @@ sudo /Applications/Mullvad\ VPN.app/Contents/Resources/mullvad-setup reset-firew
sudo /Applications/Mullvad\ VPN.app/Contents/Resources/mullvad-setup remove-device || echo "Failed to remove device from account"
echo "Removing zsh shell completion symlink ..."
-sudo rm -f /usr/local/share/zsh/site-functions/_mullvad
+sudo rm -f "/opt/homebrew/share/zsh/site-functions/_mullvad"
+sudo rm -f "/usr/local/share/zsh/site-functions/_mullvad"
echo "Removing fish shell completion symlink ..."
-
sudo rm -f "/opt/homebrew/share/fish/vendor_completions.d/mullvad.fish"
sudo rm -f "/usr/local/share/fish/vendor_completions.d/mullvad.fish"