diff --git a/index.js b/index.js index 172de44..d3be5d8 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,9 @@ module.exports = function () { return process.env.COMPUTERNAME case 'darwin': return cp.execSync('scutil --get ComputerName').toString().trim() + case 'linux': + const prettyname = cp.execSync('hostnamectl --pretty').toString().trim() + return prettyname === '' ? os.hostname() : prettyname default: return os.hostname() }