Skip to content

Instantly share code, notes, and snippets.

@n0ts
Created August 23, 2013 10:02
Show Gist options
  • Save n0ts/6317641 to your computer and use it in GitHub Desktop.
Save n0ts/6317641 to your computer and use it in GitHub Desktop.
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