fixes illegal option message from uname on macOs

This commit is contained in:
Andreas Zitzelsberger 2019-06-06 11:55:29 +02:00
parent e028cf5c90
commit 635663bdd2
No known key found for this signature in database
GPG Key ID: A563230BBA8793D7
1 changed files with 4 additions and 2 deletions

View File

@ -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}}