1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-22 07:43:09 +00:00

Override PATH on MacOS to find borg bin. By @greigdp (#2166)

This commit is contained in:
greigdp 2024-12-12 20:13:32 +00:00 committed by GitHub
parent fcc53e9ba8
commit c64db22afd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -203,7 +203,13 @@ def prepare(cls, profile):
@classmethod
def prepare_bin(cls):
"""Find packaged borg binary. Prefer globally installed."""
# On MacOS, the PATH environment variable does not seem to be set when run as a pyinstaller binary.
# More info at https://github.com/borgbase/vorta/issues/2100
# Set the path to also find homebrew installs of Borg, and avoid falling back to the embedded binary.
if sys.platform == 'darwin':
current_path = os.environ.get("PATH", "/usr/bin:/bin")
os.environ["PATH"] = f"{current_path}:/opt/homebrew/bin:/usr/local/bin"
# Now continue looking for the borg binary to use
borg_in_path = shutil.which('borg')
if borg_in_path: