diff --git a/CHANGELOG.md b/CHANGELOG.md index d15334a..c02ac70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Fancy Git Changelog +### v6.0.1 + +- Fix Python virtual environment when in a git repository path. + ### v6.0.0 - Add Python virtual environment support. diff --git a/prompt_styles/dark-double-line.sh b/prompt_styles/dark-double-line.sh index 2cdac3f..06741ed 100644 --- a/prompt_styles/dark-double-line.sh +++ b/prompt_styles/dark-double-line.sh @@ -21,6 +21,7 @@ fancygit_prompt_builder() { path_end="${none}${bold_none}" branch="${s_darkgray_bgwhite}${bg_white}${black}${bold}" branch_end="${bg_none}${none}${bold_none}${s_white}" + local venv="" # Building prompt if [ "$branch_status" != "" ] @@ -71,16 +72,6 @@ fancygit_prompt_builder() { branch_name="${branch_name}*" fi - if [ "$branch_name" != "" ] - then - prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" - prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" - PS1="${prompt_user}${prompt_path}${prompt_branch}${prompt_symbol} " - return - fi - - local venv="" - if ! [ -z ${VIRTUAL_ENV} ] then prompt_user="${user_at_host} \\u@\\h ${user_at_host_end}" @@ -88,6 +79,14 @@ fancygit_prompt_builder() { venv="${bg_dark_gray}${bold}${white}${venv} ${path_end}${s_darkgray_bgdarkgray01}" fi + if [ "$branch_name" != "" ] + then + prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" + prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" + PS1="${venv}${prompt_user}${prompt_path}${prompt_branch}${prompt_symbol} " + return + fi + PS1="${venv}${prompt_user}${prompt_path}${prompt_symbol} " } diff --git a/prompt_styles/dark.sh b/prompt_styles/dark.sh index 1d5d13e..34366f9 100644 --- a/prompt_styles/dark.sh +++ b/prompt_styles/dark.sh @@ -21,6 +21,7 @@ fancygit_prompt_builder() { path_end="${none}${bold_none}" branch="${s_darkgray01_bgwhite}${bg_white}${black}${bold}" branch_end="${bg_none}${none}${bold_none}${s_white}" + local venv="" # Building prompt if [ "$branch_status" != "" ] @@ -71,16 +72,6 @@ fancygit_prompt_builder() { branch_name="${branch_name}*" fi - if [ "$branch_name" != "" ] - then - prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" - prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" - PS1="${prompt_user}${prompt_symbol}${prompt_path}${prompt_branch} " - return - fi - - local venv="" - if ! [ -z ${VIRTUAL_ENV} ] then prompt_user="${user_at_host} \\u@\\h ${user_at_host_end}" @@ -88,6 +79,14 @@ fancygit_prompt_builder() { venv="${bg_dark_gray}${bold}${white}${venv} ${path_end}${s_darkgray_bgdarkgray01}" fi + if [ "$branch_name" != "" ] + then + prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" + prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" + PS1="${venv}${prompt_user}${prompt_symbol}${prompt_path}${prompt_branch} " + return + fi + PS1="${venv}${prompt_user}${prompt_symbol}${prompt_path} " } diff --git a/prompt_styles/default.sh b/prompt_styles/default.sh index c2da0cd..f22d87a 100644 --- a/prompt_styles/default.sh +++ b/prompt_styles/default.sh @@ -21,6 +21,7 @@ fancygit_prompt_builder() { user_symbol_end="${none}${bold_none}${bg_none}${s_lightmagenta_bgblue}" branch="${s_blue_bgwhite}${bg_white}${black}${bold}" branch_end="${bg_none}${none}${bold_none}${s_white}" + local venv="" # Building prompt if [ "$branch_status" != "" ] @@ -71,16 +72,6 @@ fancygit_prompt_builder() { branch_name="${branch_name}*" fi - if [ "$branch_name" != "" ] - then - prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" - prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" - PS1="${prompt_user}${prompt_symbol}${prompt_path}${prompt_branch} " - return - fi - - local venv="" - if ! [ -z ${VIRTUAL_ENV} ] then prompt_user="${user_at_host} \\u@\\h ${user_at_host_end}" @@ -88,6 +79,14 @@ fancygit_prompt_builder() { venv="${bg_light_magenta}${bold}${white}${venv} ${path_end}${s_lightmagenta_bgdarkgray}" fi + if [ "$branch_name" != "" ] + then + prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" + prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" + PS1="${venv}${prompt_user}${prompt_symbol}${prompt_path}${prompt_branch} " + return + fi + PS1="${venv}${prompt_user}${prompt_symbol}${prompt_path} " } diff --git a/prompt_styles/fancy-double-line.sh b/prompt_styles/fancy-double-line.sh index f0ec135..908e477 100644 --- a/prompt_styles/fancy-double-line.sh +++ b/prompt_styles/fancy-double-line.sh @@ -21,6 +21,7 @@ fancygit_prompt_builder() { user_symbol_end="${none}${bold_none}${bg_none}${s_dark_gray_bgnone}" branch="${s_blue_bgwhite}${bg_white}${black}${bold}" branch_end="${bg_none}${none}${bold_none}${s_white}" + local venv="" # Building prompt if [ "$branch_status" != "" ] @@ -71,16 +72,6 @@ fancygit_prompt_builder() { branch_name="${branch_name}*" fi - if [ "$branch_name" != "" ] - then - prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" - prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" - PS1="${prompt_user}${prompt_path}${prompt_branch}${prompt_symbol} " - return - fi - - local venv="" - if ! [ -z ${VIRTUAL_ENV} ] then prompt_user="${user_at_host} \\u@\\h ${user_at_host_end}" @@ -88,6 +79,14 @@ fancygit_prompt_builder() { venv="${bg_light_magenta}${bold}${white}${venv} ${path_end}${s_lightmagenta_bgdarkgray}" fi + if [ "$branch_name" != "" ] + then + prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" + prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" + PS1="${venv}${prompt_user}${prompt_path}${prompt_branch}${prompt_symbol} " + return + fi + PS1="${venv}${prompt_user}${prompt_path}${prompt_symbol} " } diff --git a/prompt_styles/light-double-line.sh b/prompt_styles/light-double-line.sh index f23ea4e..edd56d1 100644 --- a/prompt_styles/light-double-line.sh +++ b/prompt_styles/light-double-line.sh @@ -21,6 +21,7 @@ fancygit_prompt_builder() { path_end="${none}${bold_none}" branch="${s_lightgray_bgwhite}${bg_white}${black}${bold}" branch_end="${bg_none}${none}${bold_none}${s_white}" + local venv="" # Building prompt if [ "$branch_status" != "" ] @@ -71,16 +72,6 @@ fancygit_prompt_builder() { branch_name="${branch_name}*" fi - if [ "$branch_name" != "" ] - then - prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" - prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" - PS1="${prompt_user}${prompt_path}${prompt_branch}${prompt_symbol} " - return - fi - - local venv="" - if ! [ -z ${VIRTUAL_ENV} ] then prompt_user="${user_at_host} \\u@\\h ${user_at_host_end}" @@ -88,6 +79,14 @@ fancygit_prompt_builder() { venv="${bg_light_gray}${bold}${black}${venv} ${path_end}${s_lightgray_bgwhite}" fi + if [ "$branch_name" != "" ] + then + prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" + prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" + PS1="${venv}${prompt_user}${prompt_path}${prompt_branch}${prompt_symbol} " + return + fi + PS1="${venv}${prompt_user}${prompt_path}${prompt_symbol} " } diff --git a/prompt_styles/light.sh b/prompt_styles/light.sh index 7c79436..18bf04e 100644 --- a/prompt_styles/light.sh +++ b/prompt_styles/light.sh @@ -21,6 +21,7 @@ fancygit_prompt_builder() { path_end="${none}${bold_none}" branch="${s_lightgray_bgwhite}${bg_white}${black}${bold}" branch_end="${bg_none}${none}${bold_none}${s_white}" + local venv="" # Building prompt if [ "$branch_status" != "" ] @@ -71,16 +72,6 @@ fancygit_prompt_builder() { branch_name="${branch_name}*" fi - if [ "$branch_name" != "" ] - then - prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" - prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" - PS1="${prompt_user}${prompt_symbol}${prompt_path}${prompt_branch} " - return - fi - - local venv="" - if ! [ -z ${VIRTUAL_ENV} ] then prompt_user="${user_at_host} \\u@\\h ${user_at_host_end}" @@ -88,6 +79,14 @@ fancygit_prompt_builder() { venv="${bg_white}${bold}${black}${venv} ${path_end}${s_white_bglightgray}" fi + if [ "$branch_name" != "" ] + then + prompt_path="${path_git}${has_unpushed_commits}${has_git_stash}${has_untracked_files}${has_changed_files}${has_added_files} \\w ${path_end}" + prompt_branch="${branch} ${branch_icon} ${branch_name} ${branch_end}" + PS1="${venv}${prompt_user}${prompt_symbol}${prompt_path}${prompt_branch} " + return + fi + PS1="${venv}${prompt_user}${prompt_symbol}${prompt_path} " } diff --git a/version.sh b/version.sh index 90ce1e5..d9beec3 100644 --- a/version.sh +++ b/version.sh @@ -3,4 +3,4 @@ # Author: Diogo Alexsander Cavilha # Date: 11.17.2017 -FANCYGIT_VERSION="6.0.0" +FANCYGIT_VERSION="6.0.1"