Browse Source

Return 1 when GNU Core Utilities are not found

master
Sorin Ionescu 12 years ago
parent
commit
9155aea2db
  1. 29
      plugins/gnu-utils/init.zsh

29
plugins/gnu-utils/init.zsh

@ -5,8 +5,12 @@ @@ -5,8 +5,12 @@
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
if (( $+commands[gdircolors] )); then
function __gnu_utils {
# Check for the presence of GNU Core Utilities.
if (( ! $+commands[gdircolors] )); then
return 1
fi
function __gnu_utils {
emulate -L zsh
local gcmds
local gcmd
@ -43,32 +47,31 @@ if (( $+commands[gdircolors] )); then @@ -43,32 +47,31 @@ if (( $+commands[gdircolors] )); then
done
return 0
}
__gnu_utils;
}
__gnu_utils;
function hash {
function hash {
if (( $+argv[(er)-r] )) || (( $+argv[(er)-f] )); then
builtin hash "$@"
__gnu_utils
else
builtin hash "$@"
fi
}
}
function rehash {
function rehash {
hash -r "$@"
}
}
# A sensible default for ls.
alias ls='ls --group-directories-first'
# A sensible default for ls.
alias ls='ls --group-directories-first'
if zstyle -t ':omz:alias:ls' color; then
if zstyle -t ':omz:alias:ls' color; then
if [[ -f "$HOME/.dir_colors" ]]; then
eval $(gdircolors "$HOME/.dir_colors")
fi
alias ls="$aliases[ls] --color=auto"
else
else
alias ls="$aliases[ls] -F"
fi
fi

Loading…
Cancel
Save