mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-07-22 16:07:00 +00:00
Fix hostname query on non-systemd distributions
This commit is contained in:
parent
4524a0ee6a
commit
be93dcf03d
1 changed files with 1 additions and 2 deletions
|
@ -13,8 +13,7 @@ export class DiscoveryService {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
return cp.execSync("scutil --get ComputerName").toString().trim();
|
return cp.execSync("scutil --get ComputerName").toString().trim();
|
||||||
case "linux":
|
case "linux":
|
||||||
const prettyname = cp.execSync("hostnamectl --pretty").toString().trim();
|
return os.hostname();
|
||||||
return prettyname === "" ? os.hostname() : prettyname;
|
|
||||||
default:
|
default:
|
||||||
return os.hostname();
|
return os.hostname();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue