mac/app: add homebrew ARM install paths to the bundle PATH environment

since the bundle operates in a different shell environment than the one
from the terminal, it only has a few default paths set.

add the homebrew ARM default install paths to the PATH environment
variable, so the bundle can also find the needed binaries like yt-dl.
This commit is contained in:
der richter 2024-10-13 14:48:29 +02:00
parent 9a1c637e9e
commit d6aef54adb
1 changed files with 3 additions and 1 deletions

View File

@ -87,7 +87,9 @@ class Application: NSApplication, NSApplicationDelegate {
}
let path = (ProcessInfo.processInfo.environment["PATH"] ?? "") +
":/usr/local/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin"
":/usr/local/bin:/usr/local/sbin" + // homebrew Intel
":/opt/local/bin:/opt/local/sbin" + // MacPorts
":/opt/homebrew/bin:/opt/homebrew/sbin" // homebrew ARM
appHub.log.verbose("Setting Bundle $PATH to: \(path)")
_ = path.withCString { setenv("PATH", $0, 1) }
}