mirror of
https://github.com/borgbase/vorta
synced 2025-01-02 21:25:48 +00:00
Override $PATH for MacOS to find platform-native homebrew borg binaries (#2100)
This commit is contained in:
parent
fcc53e9ba8
commit
1e8d9ecac2
1 changed files with 6 additions and 1 deletions
|
@ -203,7 +203,12 @@ def prepare(cls, profile):
|
||||||
@classmethod
|
@classmethod
|
||||||
def prepare_bin(cls):
|
def prepare_bin(cls):
|
||||||
"""Find packaged borg binary. Prefer globally installed."""
|
"""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')
|
borg_in_path = shutil.which('borg')
|
||||||
|
|
||||||
if borg_in_path:
|
if borg_in_path:
|
||||||
|
|
Loading…
Reference in a new issue