fix: add PATH environment variable to launchd plist
Add EnvironmentVariables to plist so commands can be found when the service runs at login. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8b5f3430a1
commit
ca1eef200a
1 changed files with 7 additions and 1 deletions
|
|
@ -1536,6 +1536,7 @@ func findExecutable() (string, error) {
|
|||
|
||||
// generatePlist generates the plist content for launch agent
|
||||
func generatePlist(execPath string) string {
|
||||
home := os.Getenv("HOME")
|
||||
return fmt.Sprintf(`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
|
|
@ -1551,8 +1552,13 @@ func generatePlist(execPath string) string {
|
|||
<true/>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>PATH</key>
|
||||
<string>/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:%s/.local/bin:%s/bin</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>`, execPath)
|
||||
</plist>`, execPath, home, home)
|
||||
}
|
||||
|
||||
// uninstallInstall uninstalls the launch agent
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue