mirror of
https://github.com/borgbase/vorta
synced 2024-12-21 23:33:13 +00:00
Override PATH on MacOS to find borg bin. By @greigdp (#2166)
This commit is contained in:
parent
fcc53e9ba8
commit
c64db22afd
1 changed files with 7 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue