mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Don't return null for unknown os name
This commit is contained in:
parent
522c2c1664
commit
a6cb7b1a30
1 changed files with 2 additions and 2 deletions
|
@ -141,14 +141,14 @@ public sealed interface OsType permits OsType.Windows, OsType.Linux, OsType.MacO
|
|||
try (CommandControl c = pc.command("lsb_release -a").start()) {
|
||||
var text = c.readStdoutDiscardErr();
|
||||
if (c.getExitCode() == 0) {
|
||||
return PropertiesFormatsParser.parse(text, ":").getOrDefault("Description", null);
|
||||
return PropertiesFormatsParser.parse(text, ":").getOrDefault("Description", "Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
try (CommandControl c = pc.command("cat /etc/*release").start()) {
|
||||
var text = c.readStdoutDiscardErr();
|
||||
if (c.getExitCode() == 0) {
|
||||
return PropertiesFormatsParser.parse(text, "=").getOrDefault("PRETTY_NAME", null);
|
||||
return PropertiesFormatsParser.parse(text, "=").getOrDefault("PRETTY_NAME", "Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue