Merge pull request #698 from picatz/fix-platformFamily-on-macOS

Update host_darwin.go
pull/701/head
shirou 6 years ago committed by GitHub
commit a83baef6e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -189,6 +189,16 @@ func PlatformInformationWithContext(ctx context.Context) (string, string, string
pver = strings.ToLower(strings.TrimSpace(string(out)))
}
// check if the macos server version file exists
_, err = os.Stat("/System/Library/CoreServices/ServerVersion.plist")
// server file doesn't exist
if os.IsNotExist(err) {
family = "Standalone Workstation"
} else {
family = "Server"
}
return platform, family, pver, nil
}

Loading…
Cancel
Save