Use hostname as default for computr name

This commit is contained in:
Rezart Qelibari
2022-04-04 17:32:45 +02:00
parent 0fd4ed6479
commit b96fe10a72
2 changed files with 17 additions and 1 deletions

View File

@@ -1,7 +1,14 @@
#!/usr/bin/env zsh
function getDefaultFullname() {
function getComputerName() {
local moduleAnswer
local computerName="`scutil --get ComputerName 2> /dev/null`"
getModuleAnswerByKeyRegEx '_hostname$' && computerName=$moduleAnswer
print -- $computerName
}
function getDefaultFullname() {
local computerName="`getComputerName`"
lop -- -d 'Default full name based on current computer name is:' -d "$computerName"
print "${computerName}"
}