Skip to content

Commit

Permalink
Override $PATH for MacOS to find platform-native homebrew borg binari…
Browse files Browse the repository at this point in the history
…es (#2100)
  • Loading branch information
greigdp committed Dec 10, 2024
1 parent fcc53e9 commit 1e8d9ec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/vorta/borg/borg_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,12 @@ 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':
os.environ["PATH"]="/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin"
# Now continue looking for the borg binary to use
borg_in_path = shutil.which('borg')

if borg_in_path:
Expand Down

0 comments on commit 1e8d9ec

Please sign in to comment.