composer: Fix slowness during startup

This commit is contained in:
Michael Stucki 2018-03-06 22:10:34 +01:00
parent 2ff9560ad3
commit c640b999b4

View File

@ -4,6 +4,17 @@
# AUTHOR: Daniel Gomes (me@danielcsgomes.com)
# VERSION: 1.0.0
# ------------------------------------------------------------------------------
#
# USAGE
# -----
#
# Enable caching:
#
# If you want to use the cache, set the followings in your .zshrc:
#
# zstyle ':completion:*' use-cache yes
#
# ------------------------------------------------------------------------------
# Composer basic command completion
_composer_get_command_list () {
@ -51,5 +62,12 @@ alias cgrm='composer global remove'
# install composer in the current directory
alias cget='curl -s https://getcomposer.org/installer | php'
_retrieve_cache 'composer'
if [[ -z $__composer_bin_dir ]]; then
__composer_bin_dir=$(composer global config bin-dir --absolute 2>/dev/null)
_store_cache 'composer' __composer_bin_dir
fi
# Add Composer's global binaries to PATH
export PATH=$PATH:$(composer global config bin-dir --absolute 2>/dev/null)
export PATH=$PATH:$__composer_bin_dir