From abb0167ffabfe40e6baf662e0e0fea252865320c Mon Sep 17 00:00:00 2001 From: Omer Katz Date: Sun, 14 Dec 2014 09:52:27 +0200 Subject: [PATCH] Revert "Added pyenv-virtualenv plugin" --- .../available/pyenv-virtualenv.plugin.bash | 61 ------------------- plugins/available/pyenv.plugin.bash | 10 ++- themes/bobby/bobby.theme.bash | 2 +- 3 files changed, 8 insertions(+), 65 deletions(-) delete mode 100644 plugins/available/pyenv-virtualenv.plugin.bash diff --git a/plugins/available/pyenv-virtualenv.plugin.bash b/plugins/available/pyenv-virtualenv.plugin.bash deleted file mode 100644 index 65ccd41e..00000000 --- a/plugins/available/pyenv-virtualenv.plugin.bash +++ /dev/null @@ -1,61 +0,0 @@ -# make sure virtualenvwrapper is enabled if available - -cite about-plugin -about-plugin 'pyenv-virtualenvwrapper helper functions' - -export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true" - -[[ `which pyenv` ]] && eval "$(pyenv init -)" -[[ `which pyenv-virtualenvwrapper` ]] && eval "$(pyenv virtualenvwrapper)" - -# Activate autoenv -source /usr/local/opt/autoenv/activate.sh - -function mkpvenv { - about 'create a new virtualenv for this directory' - group 'pyenv-virtualenv' - - cwd=`basename \`pwd\`` - eval "touch .env" - eval "echo \"#!/bin/bash\" >> .env" - eval "echo \"if [ \\\`basename \\\$(pwd)\\\` == \\\"$cwd\\\" ]; then \"eval \"wopvenv\"\"; fi\" >> .env" - mkvirtualenv --distribute $cwd -} - -function mkpvbranch { - about 'create a new virtualenv for the current branch' - group 'pyenv-virtualenv' - - mkvirtualenv --distribute "$(basename `pwd`)@$SCM_BRANCH" -} - -function wopvbranch { - about 'sets workon branch' - group 'pyenv-virtualenv' - - workon "$(basename `pwd`)@$SCM_BRANCH" -} - -function wopvenv { - about 'works on the virtualenv for this directory' - group 'virtualenv' - - workon "$(basename `pwd`)" -} - -function rmpvenv { - about 'removes virtualenv for this directory' - group 'virtualenv' - - eval "deactivate" - rmvirtualenv "$(basename `pwd`)" - eval "rm .env" -} - -function rmpvenvbranch { - about 'removes virtualenv for this directory' - group 'virtualenv' - - eval "deactivate" - rmvirtualenv "$(basename `pwd`)@$SCM_BRANCH" -} \ No newline at end of file diff --git a/plugins/available/pyenv.plugin.bash b/plugins/available/pyenv.plugin.bash index dd712f87..7ed2d3cd 100644 --- a/plugins/available/pyenv.plugin.bash +++ b/plugins/available/pyenv.plugin.bash @@ -1,10 +1,14 @@ cite about-plugin about-plugin 'load pyenv, if you are using it' -export PYENV_PATH=`which pyenv` -export PATH="$PYENV_PATH:$PATH" - +export PYENV_ROOT="$HOME/.pyenv" +export PATH="$PYENV_ROOT/bin:$PATH" [[ `which pyenv` ]] && eval "$(pyenv init -)" +#Load pyenv virtualenv if the virtualenv plugin is installed. +if pyenv virtualenv-init - &> /dev/null; then + eval "$(pyenv virtualenv-init -)" +fi + # Load the auto-completion script if pyenv was loaded. [[ -e $PYENV_ROOT/completions/pyenv.bash ]] && source $PYENV_ROOT/completions/pyenv.bash diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index ccb71edd..308b412b 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -14,7 +14,7 @@ RVM_THEME_PROMPT_SUFFIX="|" function prompt_command() { #PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} " - PS1="\n${yellow}$(virtualenv_prompt)$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " + PS1="\n${yellow}$(ruby_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} " } PROMPT_COMMAND=prompt_command;