Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override $PATH for MacOS to find native homebrew borg binaries (#2100) #2166

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/vorta/borg/borg_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading