Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
dd644a1f
Commit
dd644a1f
authored
Sep 03, 2014
by
Robby Russell
Browse files
Merge pull request #2743 from docwhat/issue-2155-scutil
Trust but verify 'scutil' to return ComputerName
parents
ca0331da
00b21d5a
Changes
1
Show whitespace changes
Inline
Side-by-side
oh-my-zsh.sh
View file @
dd644a1f
...
@@ -38,9 +38,9 @@ for plugin ($plugins); do
...
@@ -38,9 +38,9 @@ for plugin ($plugins); do
done
done
# Figure out the SHORT hostname
# Figure out the SHORT hostname
if
[
-n
"
$commands
[scutil]"
]
;
then
if
[
[
"
$OSTYPE
"
=
darwin
*
]
]
;
then
# OS X
# OS X
's $HOST changes with dhcp, etc. Use ComputerName if possible.
SHORT_HOST
=
$(
scutil
--get
ComputerName
)
SHORT_HOST
=
$(
scutil
--get
ComputerName
2>/dev/null
)
||
SHORT_HOST
=
${
HOST
/.*/
}
else
else
SHORT_HOST
=
${
HOST
/.*/
}
SHORT_HOST
=
${
HOST
/.*/
}
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment