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

Workaround for #238 regression / #245 issue #247

Merged
merged 2 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Release type: patch

Restore support for older versions of Fish.
10 changes: 6 additions & 4 deletions virtualfish/loader/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ def check_fish_version():
"""Display a warning if the minimum Fish version is not installed. Bail silently if
the 'packaging' module is missing or if Fish is not installed."""
try:
import re
import subprocess
from packaging import version

cmd = ["fish", "-N", "-c", "echo $version"]
fish_version = subprocess.check_output(cmd).decode("utf-8").strip()
# Remove any extraneous hyphen-suffixed bits
fish_version = fish_version.partition("-")[0]
cmd = ["fish", "--version"]
fish_output = subprocess.check_output(cmd).decode("utf-8")
# Remove any extraneous prefix and hyphen-suffixed bits
fish_matches = re.match(r".*version ([\d\.]+)", fish_output)
fish_version = fish_matches.group(1)
if version.parse(fish_version) < version.parse(minimum_fish_version):
log.warning(
"""{}WARNING: VirtualFish requires Fish {} or higher.
Expand Down