diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/heroku/_heroku | 6 | ||||
-rw-r--r-- | plugins/pass/_pass | 2 | ||||
-rw-r--r-- | plugins/pip/pip.plugin.zsh | 6 | ||||
-rw-r--r-- | plugins/pyenv/pyenv.plugin.zsh | 31 |
4 files changed, 39 insertions, 6 deletions
diff --git a/plugins/heroku/_heroku b/plugins/heroku/_heroku index a95c38647..46663303a 100644 --- a/plugins/heroku/_heroku +++ b/plugins/heroku/_heroku @@ -23,8 +23,10 @@ _1st_arguments=( "auth\:login":"log in with your heroku credentials" "auth\:logout":"clear local authentication credentials" "config":"display the config vars for an app" - "config\:add":"add one or more config vars" - "config\:remove":"remove a config var" + "config\:pull":"pull heroku config vars down to the local environment" + "config\:push":"push local config vars to heroku" + "config\:set":"set one or more config vars" + "config\:unset":"unset one or more config vars" "db\:push":"push local data up to your app" "db\:pull":"pull heroku data down into your local database" "domains":"list custom domains for an app" diff --git a/plugins/pass/_pass b/plugins/pass/_pass index f6c1a6c4b..d8ec38828 100644 --- a/plugins/pass/_pass +++ b/plugins/pass/_pass @@ -101,7 +101,7 @@ _pass_cmd_show () { _pass_complete_entries_helper () { local IFS=$'\n' local prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" - _values -C 'passwords' $(find "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort) + _values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##' | sort) } _pass_complete_entries_with_subdirs () { diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh index 71f977bbf..b5433ae9d 100644 --- a/plugins/pip/pip.plugin.zsh +++ b/plugins/pip/pip.plugin.zsh @@ -18,12 +18,12 @@ zsh-pip-clear-cache() { } zsh-pip-clean-packages() { - sed -nr '/<a href/ s/.*>([^<]+).*/\1/p' + sed -n '/<a href/ s/.*>\([^<]\{1,\}\).*/\1/p' } zsh-pip-cache-packages() { - if [[ ! -d ${PIP_CACHE_FILE:h} ]]; then - mkdir -p ${PIP_CACHE_FILE:h} + if [[ ! -d ${ZSH_PIP_CACHE_FILE:h} ]]; then + mkdir -p ${ZSH_PIP_CACHE_FILE:h} fi if [[ ! -f $ZSH_PIP_CACHE_FILE ]]; then diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh new file mode 100644 index 000000000..b3dc7aa17 --- /dev/null +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -0,0 +1,31 @@ +_homebrew-installed() { + type brew &> /dev/null +} + +_pyenv-from-homebrew-installed() { + brew --prefix pyenv &> /dev/null +} + +FOUND_PYENV=0 +pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv") +if _homebrew-installed && _pyenv-from-homebrew-installed ; then + pyenvdirs=($(brew --prefix pyenv) "${pyenvdirs[@]}") +fi + +for pyenvdir in "${pyenvdirs[@]}" ; do + if [ -d $pyenvdir/bin -a $FOUND_PYENV -eq 0 ] ; then + FOUND_PYENV=1 + export PYENV_ROOT=$pyenvdir + export PATH=${pyenvdir}/bin:$PATH + eval "$(pyenv init --no-rehash - zsh)" + + function pyenv_prompt_info() { + echo "$(pyenv version-name)" + } + fi +done +unset pyenvdir + +if [ $FOUND_PYENV -eq 0 ] ; then + function pyenv_prompt_info() { echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')" } +fi |