Skip to content

Commit

Permalink
🐛 Fix minor bugs
Browse files Browse the repository at this point in the history
- Fix double line for default theme.
- Fix "pve" command.
- Fix python virtualenv checking.
  • Loading branch information
diogocavilha authored Mar 3, 2022
2 parents 1a9054c + ac75d9c commit c7d3481
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

> Any trouble, please visit the [troubleshooting page](https://github.com/diogocavilha/fancy-git/blob/master/TROUBLESHOOTING.md)
## v7.1.7

- Fix double line for default theme.
- Fix "pve" command.
- Fix python virtualenv checking.

## v7.1.6

- Fix code stye according to ShellCheck rules.
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ As a picture is worth a thousand words...
![006](https://github.com/diogocavilha/fancy-git/blob/master/images/default_006.png)
![007](https://github.com/diogocavilha/fancy-git/blob/master/images/default_007.png)

**Working on a Python virtual environment?**

Working on a Python virtual environment?
![python_venv](https://github.com/diogocavilha/fancy-git/blob/master/images/python_venv.png)

# :art: Themes and color schemes
Expand Down
2 changes: 1 addition & 1 deletion alias_functions/pve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

venv_name="none"

if [[ -n ${VIRTUAL_ENV} ]]; then
if [ -n "${VIRTUAL_ENV}" ]; then
venv_name=$(basename "$VIRTUAL_ENV")
fi

Expand Down
20 changes: 16 additions & 4 deletions theme-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ __fancygit_get_poor_notification_area() {
echo ""
}

# ----------------------------------------------------------------------------------------------------------------------
# Return a boolean informing if there is a conda virtualenv.
# ----------------------------------------------------------------------------------------------------------------------
__has_conda_env() {
if [ "$CONDA_DEFAULT_ENV" != "base" ] && [[ -n $CONDA_DEFAULT_ENV ]]
then
return 0
fi

return 1
}

# ----------------------------------------------------------------------------------------------------------------------
# Return the icon that indicates we're working in a virtual environment.
# ----------------------------------------------------------------------------------------------------------------------
Expand All @@ -152,7 +164,7 @@ __fancygit_get_venv_icon() {

icon_venv=""

if [[ -n $VIRTUAL_ENV ]] || [ "$CONDA_DEFAULT_ENV" != "base" ] && [[ -n $CONDA_DEFAULT_ENV ]]
if [[ -n $VIRTUAL_ENV ]] || __has_conda_env
then
echo "$icon_venv"
return
Expand All @@ -165,13 +177,13 @@ __fancygit_get_venv_icon() {
# Return the virtual environment name if it exists.
# ----------------------------------------------------------------------------------------------------------------------
fancygit_theme_get_venv_name() {
if [[ -n ${VIRTUAL_ENV} ]]
if [[ -n $VIRTUAL_ENV ]]
then
printf "%s" "$(basename "${VIRTUAL_ENV}")"
return
fi

if [ "$CONDA_DEFAULT_ENV" != "base" ] && [[ -n ${CONDA_DEFAULT_ENV} ]]
if __has_conda_env
then
printf "%s" "$(basename "${CONDA_DEFAULT_ENV}")"
return
Expand Down Expand Up @@ -219,7 +231,7 @@ fancygit_theme_get_time() {
fancygit_theme_get_double_line() {
if fancygit_config_is "double_line" "true"
then
printf "\n%s" "\n$(fancygit_config_get "ps2" "")"
printf "\n%s" "$(fancygit_config_get "ps2" "")"
fi

echo ""
Expand Down
2 changes: 1 addition & 1 deletion version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Author: Diogo Alexsander Cavilha <[email protected]>
# Date: 11.17.2017

export FANCYGIT_VERSION="7.1.6"
export FANCYGIT_VERSION="7.1.7"

0 comments on commit c7d3481

Please sign in to comment.