From 635663bdd2454a4f142d2a575b4c605c81230118 Mon Sep 17 00:00:00 2001 From: Andreas Zitzelsberger Date: Thu, 6 Jun 2019 11:55:29 +0200 Subject: [PATCH] fixes illegal option message from uname on macOs --- gitstatus/gitstatus.plugin.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh index 4809cb7a..3c5a0730 100644 --- a/gitstatus/gitstatus.plugin.zsh +++ b/gitstatus/gitstatus.plugin.zsh @@ -274,8 +274,10 @@ function gitstatus_start() { exec {stderr_fd}>&2 2>$xtrace_file setopt xtrace } - - local os && { [[ $(uname -o) == Android ]] && os=Android || os=$(uname -s) } && [[ -n $os ]] + + # uname -o fails on macOS, so suppress it's stderr output as that case + # will be caught by uname -s + local os && { [[ $(uname -o 2>/dev/null) == Android ]] && os=Android || os=$(uname -s) } && [[ -n $os ]] local arch && arch=$(uname -m) && [[ -n $arch ]] local daemon=${GITSTATUS_DAEMON:-$dir/bin/gitstatusd-${os:l}-${arch:l}}