mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-28 14:06:12 +02:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b37d4878ed |
@@ -100,7 +100,13 @@ done
|
|||||||
# Figure out the SHORT hostname
|
# Figure out the SHORT hostname
|
||||||
if [[ "$OSTYPE" = darwin* ]]; then
|
if [[ "$OSTYPE" = darwin* ]]; then
|
||||||
# macOS's $HOST changes with dhcp, etc. Use LocalHostName if possible.
|
# macOS's $HOST changes with dhcp, etc. Use LocalHostName if possible.
|
||||||
|
# When $HOST is the Bonjour name (<LocalHostName>.local) it already is the
|
||||||
|
# LocalHostName, so don't fork scutil to look it up.
|
||||||
|
if [[ "$HOST" = *.local ]]; then
|
||||||
|
SHORT_HOST="${HOST%.local}"
|
||||||
|
else
|
||||||
SHORT_HOST=$(scutil --get LocalHostName 2>/dev/null) || SHORT_HOST="${HOST/.*/}"
|
SHORT_HOST=$(scutil --get LocalHostName 2>/dev/null) || SHORT_HOST="${HOST/.*/}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
SHORT_HOST="${HOST/.*/}"
|
SHORT_HOST="${HOST/.*/}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user