From 1e8d9ecac26b4d073448b4a21502e434b0dfd5ae Mon Sep 17 00:00:00 2001 From: greigdp Date: Tue, 10 Dec 2024 00:42:22 +0000 Subject: [PATCH] Override $PATH for MacOS to find platform-native homebrew borg binaries (#2100) --- src/vorta/borg/borg_job.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vorta/borg/borg_job.py b/src/vorta/borg/borg_job.py index b66acc2d..1f17793a 100644 --- a/src/vorta/borg/borg_job.py +++ b/src/vorta/borg/borg_job.py @@ -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: