Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sw_vers doesn't work on Linux , how about lsb_release -a ? #105

Closed
liyiheng opened this issue Jun 1, 2018 · 2 comments
Closed

sw_vers doesn't work on Linux , how about lsb_release -a ? #105

liyiheng opened this issue Jun 1, 2018 · 2 comments
Labels
💪 improvement "Where we're going, we don't need roads."

Comments

@liyiheng
Copy link
Contributor

liyiheng commented Jun 1, 2018

https://github.com/senorprogrammer/wtf/blob/bf4ab1056f8f50dd8269a2b639ed155c210e83b8/system/system_info.go#L21

@senorprogrammer senorprogrammer added 💪 improvement "Where we're going, we don't need roads." medium labels Jun 1, 2018
senorprogrammer pushed a commit that referenced this issue Jun 2, 2018
- add lsb_release because sw_vers doesn't work on linux 
- add system check
@liyiheng
Copy link
Contributor Author

liyiheng commented Jun 2, 2018

I don't think it works. Output of lsb_release -a has different keys with sw_vers.
Without tests on other distros, I'm not sure about which keys to use. But it is clear that we should use different keys for Linux.

LSB Version:	1.4
Distributor ID:	Arch
Description:	Arch Linux
Release:	rolling
Codename:	n/a
sysInfo := SystemInfo{
		ProductName:    m["ProductName"],
		ProductVersion: m["ProductVersion"],
		BuildVersion:   m["BuildVersion"],
	}

@liyiheng
Copy link
Contributor Author

liyiheng commented Jun 2, 2018

Here is the output on CentOS, I think it's OK to use Distributor ID as ProductName, Description as ProductVersion and Release as BuildVersion. #124

LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.4.1708 (Core) 
Release:        7.4.1708
Codename:       Core

senorprogrammer pushed a commit that referenced this issue Jun 2, 2018
- add lsb_release because sw_vers doesn't work on linux 
- add system check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 improvement "Where we're going, we don't need roads."
Development

No branches or pull requests

2 participants