1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-07-22 07:57:00 +00:00

Fix hostname query on non-systemd distributions

This commit is contained in:
Michael Hollister 2024-10-04 17:28:52 -05:00
parent 4524a0ee6a
commit be93dcf03d

View file

@ -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();
} }