mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Refactors short host retrieval.
This commit is contained in:
parent
b6844a4389
commit
9a7069dbcb
1 changed files with 4 additions and 8 deletions
12
oh-my-zsh.sh
12
oh-my-zsh.sh
|
|
@ -31,16 +31,12 @@ find_plugin_paths() {
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize_completions() {
|
initialize_completions() {
|
||||||
# Figure out the SHORT hostname
|
# Figure out the SHORT hostname, scutil is for OS X users
|
||||||
if [ -n "$commands[scutil]" ]; then
|
local short_host
|
||||||
# OS X
|
short_host=$($(scutil --get ComputerName 2>/dev/null) || echo ${HOST/.*/})
|
||||||
SHORT_HOST=$(scutil --get ComputerName)
|
|
||||||
else
|
|
||||||
SHORT_HOST=${HOST/.*/}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Save the location of the current completion dump file.
|
# Save the location of the current completion dump file.
|
||||||
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
|
ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${short_host}-${ZSH_VERSION}"
|
||||||
|
|
||||||
# plugins need to be added to the functions path before compinit
|
# plugins need to be added to the functions path before compinit
|
||||||
fpath=($ZSH_PLUGIN_PATHS $fpath)
|
fpath=($ZSH_PLUGIN_PATHS $fpath)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue