From 0b9c6abef6c23dde506d4e387d36938bf05583d5 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Thu, 14 May 2020 16:39:55 -0700 Subject: [PATCH] Silence compinit when it finds shared Homebrew stuff --- zshrc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index c75040b..bee7c98 100755 --- a/zshrc +++ b/zshrc @@ -290,8 +290,21 @@ bindkey -e # emacs style key bindings # 10. Completion # ============= + autoload -Uz compinit -compinit + +# Sharing Homebrew in /usr/local with multiple users on the same machine means +# that group writable files in /usr/local are deemed insecure. But I'm the only +# actual user so tell compinit not to bother me about compaudit's complaints. +is_group_writable() { + local ls=$(ls -ld "$1") + [[ "${ls:5:1}" = "w" ]] +} +if mac && is_group_writable /usr/local/share; then + compinit -u +else + compinit +fi # 11. SSH Keychain # ================