github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/status/status_darwin.go (about) 1 // Copyright 2019 Keybase, Inc. All rights reserved. Use of 2 // this source code is governed by the included BSD license. 3 4 //go:build darwin 5 // +build darwin 6 7 package status 8 9 import ( 10 "strings" 11 12 "github.com/keybase/client/go/install" 13 "github.com/keybase/client/go/libkb" 14 "github.com/keybase/client/go/protocol/keybase1" 15 ) 16 17 func osSpecific(mctx libkb.MetaContext, status *keybase1.FullStatus) error { 18 serviceStatus := install.KeybaseServiceStatus(mctx.G(), "service", 0, mctx.G().Log) 19 kbfsStatus := install.KeybaseServiceStatus(mctx.G(), "kbfs", 0, mctx.G().Log) 20 21 productVersion, buildVersion, err := libkb.OSVersionAndBuild() 22 if err != nil { 23 mctx.Debug("Error determining OS version: %s", err) 24 } 25 status.ExtStatus.PlatformInfo.OsVersion = strings.Join([]string{productVersion, buildVersion}, "-") 26 27 if len(serviceStatus.Pid) > 0 { 28 status.Service.Running = true 29 status.Service.Pid = serviceStatus.Pid 30 } 31 32 if len(kbfsStatus.Pid) > 0 { 33 status.Kbfs.Running = true 34 status.Kbfs.Pid = kbfsStatus.Pid 35 } 36 37 return nil 38 }