File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1+ Release type: patch
2+
3+ Restore support for older versions of Fish.
Original file line number Diff line number Diff line change @@ -25,13 +25,15 @@ def check_fish_version():
2525 """Display a warning if the minimum Fish version is not installed. Bail silently if
2626 the 'packaging' module is missing or if Fish is not installed."""
2727 try :
28+ import re
2829 import subprocess
2930 from packaging import version
3031
31- cmd = ["fish" , "-N" , "-c" , "echo $version" ]
32- fish_version = subprocess .check_output (cmd ).decode ("utf-8" ).strip ()
33- # Remove any extraneous hyphen-suffixed bits
34- fish_version = fish_version .partition ("-" )[0 ]
32+ cmd = ["fish" , "--version" ]
33+ fish_output = subprocess .check_output (cmd ).decode ("utf-8" )
34+ # Remove any extraneous prefix and hyphen-suffixed bits
35+ fish_matches = re .match (r".*version ([\d\.]+)" , fish_output )
36+ fish_version = fish_matches .group (1 )
3537 if version .parse (fish_version ) < version .parse (minimum_fish_version ):
3638 log .warning (
3739 """{}WARNING: VirtualFish requires Fish {} or higher.
You can’t perform that action at this time.
0 commit comments