Skip to content

Instantly share code, notes, and snippets.

@n0ts
Created Aug 23, 2013
Embed
What would you like to do?
zsh aws completion for pyenv
# pyenv
if [ -f "$HOME/.pyenv/version" ]; then
# awscli
if [ -f "$HOME/.pyenv/versions/$(cat $HOME/.pyenv/version)/bin/aws_zsh_completer.sh" ]; then
source $HOME/.pyenv/versions/$(cat $HOME/.pyenv/version)/bin/aws_zsh_completer.sh
fi
fi
@yyuu
Copy link

yyuu commented Aug 26, 2013

恐らく↓のような感じで書いたほうがすっきりするように思います。似たようなことをやってる https://github.com/yyuu/pyenv-virtualenvwrapper の実装も確認してみてください。

if pyenv which aws_zsh_completer.sh 1>/dev/null 2>&1; then
  source "$(pyenv which aws_zsh_completer.sh)"
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment