Skip to content

Commit

Permalink
✨ Add "pve" command
Browse files Browse the repository at this point in the history
pve stands for "Present Virtual Environment".
It shows the current Python Virtual environment name.
  • Loading branch information
diogocavilha committed Jun 22, 2019
1 parent 92cf7a0 commit 0d38207
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Fancy Git Changelog

### v6.0.3

- Add the `pve` command to show the current Python virtual environment name.

### v6.0.2

- Add a ghost icon to indicate you're working on a Python virtual environment. (Only colored themes)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ Basically, most of the Fancy Git aliases work this way.
| gstd | git stash drop \<stash_id\> [file](https://github.com/diogocavilha/fancy-git/blob/master/alias_functions/gstd.sh) | Drop specific stash.
| gg "\<message\>" | git add --all && git commit -m "\<message\>" && git push [file](https://github.com/diogocavilha/fancy-git/blob/master/alias_functions/gg.sh) | Add all changes, then commit and push them.
| gu \<file\> [<other_file>] | git reset HEAD \<file\> | Remove files from staging area.
| pve | [file](https://github.com/diogocavilha/fancy-git/blob/master/alias_functions/pve.sh) | Show the current Python virtual environment name.

# Contributing :rocket:

- Give a star to the project =D
- Give this project a star =D
- Fork the project.
- Create a branch in order to implement your changes. (`git checkout -b your-branch-name`).
- Send a Pull Request.
Expand Down
16 changes: 16 additions & 0 deletions alias_functions/pve.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
#
# Author: Diogo Alexsander Cavilha <diogocavilha@gmail.com>
# Date: 06.22.2019
#
# Show the current Python virtual environment name.

venv_name="none"

if ! [ -z ${VIRTUAL_ENV} ]; then
venv_name="`basename \"$VIRTUAL_ENV\"`"
fi

echo ""
echo "Python virtual environment: ${venv_name}"
echo ""
1 change: 1 addition & 0 deletions aliases
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ alias gsta="sh ~/.fancy-git/alias_functions/gsta.sh"
alias gstd="sh ~/.fancy-git/alias_functions/gstd.sh"
alias gg="sh ~/.fancy-git/alias_functions/gg.sh"
alias gu="git reset HEAD"
alias pve="sh ~/.fancy-git/alias_functions/pve.sh"
2 changes: 2 additions & 0 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
local separator
local branch_icon
local is_git_repo
local has_git_stash
local has_untracked_files
local has_changed_files
local has_added_files
local has_unpushed_commits
local working_on_venv

separator=""
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 <diogocavilha@gmail.com>
# Date: 11.17.2017

FANCYGIT_VERSION="6.0.2"
FANCYGIT_VERSION="6.0.3"

0 comments on commit 0d38207

Please sign in to comment.