1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-11-16 06:11:13 +00:00
prezto/plugins/git/completion.zsh

23 lines
759 B
Bash
Raw Normal View History

# Get the latest Git completion.
2011-10-12 03:13:58 +00:00
completion_file="${0:h}/completions/_git"
completion_file_url='http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=blob_plain;f=Completion/Unix/Command/_git;hb=HEAD'
if [[ ! -e "$completion_file" ]] && (( $+commands[git] )); then
2011-10-12 03:13:58 +00:00
# Remove empty completions directory.
if [[ -d "${completion_file:h}"(/^F) ]]; then
rmdir "${completion_file:h}" 2> /dev/null
fi
2011-10-12 03:13:58 +00:00
if mkdir -p "${completion_file:h}" > /dev/null; then
if (( $+commands[curl] )); then
curl -L "$completion_file_url" -o "$completion_file" &> /dev/null &!
fi
if (( $+commmands[wget] )); then
wget -C "$completion_file_url" -O "$completion_file" &> /dev/null &!
fi
fi
fi
unset completion_file
unset completion_file_url