fix: report macos product version in presence
This commit is contained in:
@@ -69,10 +69,17 @@ function initSelfPresence() {
|
||||
}
|
||||
return os.arch();
|
||||
})();
|
||||
const macOSVersion = () => {
|
||||
const res = spawnSync("sw_vers", ["-productVersion"], {
|
||||
encoding: "utf-8",
|
||||
});
|
||||
const out = typeof res.stdout === "string" ? res.stdout.trim() : "";
|
||||
return out.length > 0 ? out : os.release();
|
||||
};
|
||||
const platform = (() => {
|
||||
const p = os.platform();
|
||||
const rel = os.release();
|
||||
if (p === "darwin") return `macos ${rel}`;
|
||||
if (p === "darwin") return `macos ${macOSVersion()}`;
|
||||
if (p === "win32") return `windows ${rel}`;
|
||||
return `${p} ${rel}`;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user