From b1a5191883252144e5f9da317610383567584b7d Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Wed, 10 Feb 2021 18:47:53 -0800 Subject: [PATCH] [zshrc] Fix error when /usr/local/share doesn't exist --- zshrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zshrc b/zshrc index 4cbc5ac..da28655 100755 --- a/zshrc +++ b/zshrc @@ -303,8 +303,7 @@ autoload -Uz compinit # 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" ]] + [[ -d "$1" ]] && [[ "${$(ls -ld "$1"):5:1}" = "w" ]] } if mac && is_group_writable /usr/local/share; then compinit -u