Don't fail to sync without hostnamectl
This commit is contained in:
parent
79d8d79b9d
commit
64096de3f8
@ -34,8 +34,11 @@ export const getComputerName = () => {
|
||||
name = cp.execSync('scutil --get ComputerName').toString().trim()
|
||||
break
|
||||
case 'linux':
|
||||
name = cp.execSync('hostnamectl --pretty').toString().trim()
|
||||
break
|
||||
try {
|
||||
name = cp.execSync('hostnamectl --pretty').toString().trim()
|
||||
}
|
||||
// Don't fail even if hostnamectl is unavailable
|
||||
finally { break }
|
||||
}
|
||||
if (!name) name = os.hostname()
|
||||
return name
|
||||
|
||||
Loading…
Reference in New Issue
Block a user