Use $+functions to determine if a function exists

This commit is contained in:
Kaleb Elwert 2017-02-28 12:05:34 -08:00
parent edd7823388
commit 6ea9aadf7a

View File

@ -187,7 +187,7 @@ prompt_hg() {
# Dir: current working directory # Dir: current working directory
prompt_dir() { prompt_dir() {
if type shrink_path &>/dev/null; then if (( $+functions[shrink_path] )); then
prompt_segment blue black "$(shrink_path -t -l)" prompt_segment blue black "$(shrink_path -t -l)"
else else
prompt_segment blue black '%~' prompt_segment blue black '%~'