File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,16 @@ def _get_latest_compatible_release(releases):
123
123
if firefox_version in release ["supported" ]:
124
124
return release
125
125
return None
126
-
126
+ def _get_firefox_version (bin = "firefox" ):
127
+ try :
128
+ ver_string = check_output ([bin , "--version" ], encoding = "UTF-8" )
129
+ return ver_string [ver_string .rindex (" " )+ 1 :].strip ()
130
+ except FileNotFoundError :
131
+ default_path = str (DEFAULT_FIREFOX_INSTALL .joinpath ("firefox" ))
132
+ if bin != default_path : # Avoid infinite recursion
133
+ return _get_firefox_version (default_path )
134
+ else :
135
+ raise Exception ("Firefox binary not found. Please ensure Firefox is installed and the path is correct." )
127
136
128
137
def backup_profile (src ):
129
138
dest = f"{ src } -backup-{ datetime .today ().strftime ('%Y-%m-%d-%H-%M-%S' )} "
You can’t perform that action at this time.
0 commit comments