Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an error when Python is not installed #553

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions functions/_tide_item_python.fish
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ function _tide_item_python
if test -n "$VIRTUAL_ENV"
if command -q python3
python3 --version | string match -qr "(?<v>[\d.]+)"
else
else if command -q python
python --version | string match -qr "(?<v>[\d.]+)"
else
return
end
string match -qr "^.*/(?<dir>.*)/(?<base>.*)" $VIRTUAL_ENV
# pipenv $VIRTUAL_ENV looks like /home/ilan/.local/share/virtualenvs/pipenv_project-EwRYuc3l
Expand All @@ -19,8 +21,10 @@ function _tide_item_python
else if path is .python-version Pipfile __init__.py pyproject.toml requirements.txt setup.py
if command -q python3
python3 --version | string match -qr "(?<v>[\d.]+)"
else
else if command -q python
python --version | string match -qr "(?<v>[\d.]+)"
else
return
end
_tide_print_item python $tide_python_icon' ' $v
end
Expand Down
Loading