1
0
mirror of https://github.com/yokoffing/Betterfox.git synced 2026-06-12 07:30:47 +05:30

Update install.py (#369)

Updating to Check Location of Firefox Install
This commit is contained in:
Michael Weems
2025-02-25 16:30:05 -06:00
committed by GitHub
parent 09dd87a3ab
commit 9c1d652299
+10 -1
View File
@@ -123,7 +123,16 @@ def _get_latest_compatible_release(releases):
if firefox_version in release["supported"]:
return release
return None
def _get_firefox_version(bin="firefox"):
try:
ver_string = check_output([bin, "--version"], encoding="UTF-8")
return ver_string[ver_string.rindex(" ")+1:].strip()
except FileNotFoundError:
default_path = str(DEFAULT_FIREFOX_INSTALL.joinpath("firefox"))
if bin != default_path: # Avoid infinite recursion
return _get_firefox_version(default_path)
else:
raise Exception("Firefox binary not found. Please ensure Firefox is installed and the path is correct.")
def backup_profile(src):
dest = f"{src}-backup-{datetime.today().strftime('%Y-%m-%d-%H-%M-%S')}"