update sysinfo due to breaking change with get_version (#2988)

This commit is contained in:
Darren Schroeder
2021-01-30 12:21:32 -06:00
committed by GitHub
parent 44e088c6fe
commit 87c7898b65
4 changed files with 15 additions and 6 deletions

View File

@ -18,6 +18,6 @@ nu-source = { path = "../nu-source", version = "0.26.0" }
futures = { version = "0.3.5", features = ["compat", "io-compat"] }
futures-util = "0.3.5"
num-bigint = "0.3.0"
sysinfo = "0.15.9"
sysinfo = "0.15.11"
[build-dependencies]

View File

@ -115,8 +115,17 @@ pub fn host(sys: &mut System, tag: Tag) -> Option<UntaggedValue> {
if let Some(name) = sys.get_name() {
dict.insert_untagged("name", UntaggedValue::string(trim_cstyle_null(name)));
}
if let Some(version) = sys.get_version() {
dict.insert_untagged("version", UntaggedValue::string(trim_cstyle_null(version)));
if let Some(version) = sys.get_os_version() {
dict.insert_untagged(
"os version",
UntaggedValue::string(trim_cstyle_null(version)),
);
}
if let Some(version) = sys.get_kernel_version() {
dict.insert_untagged(
"kernel version",
UntaggedValue::string(trim_cstyle_null(version)),
);
}
if let Some(hostname) = sys.get_host_name() {
dict.insert_untagged(