fix: use current PATH instead of hardcoded path in launchd plist
This commit is contained in:
parent
ca1eef200a
commit
05c08dfa74
1 changed files with 3 additions and 3 deletions
|
|
@ -1536,7 +1536,7 @@ func findExecutable() (string, error) {
|
||||||
|
|
||||||
// generatePlist generates the plist content for launch agent
|
// generatePlist generates the plist content for launch agent
|
||||||
func generatePlist(execPath string) string {
|
func generatePlist(execPath string) string {
|
||||||
home := os.Getenv("HOME")
|
currentPath := os.Getenv("PATH")
|
||||||
return fmt.Sprintf(`<?xml version="1.0" encoding="UTF-8"?>
|
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">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
|
|
@ -1555,10 +1555,10 @@ func generatePlist(execPath string) string {
|
||||||
<key>EnvironmentVariables</key>
|
<key>EnvironmentVariables</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>PATH</key>
|
<key>PATH</key>
|
||||||
<string>/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:%s/.local/bin:%s/bin</string>
|
<string>%s</string>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>`, execPath, home, home)
|
</plist>`, execPath, currentPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// uninstallInstall uninstalls the launch agent
|
// uninstallInstall uninstalls the launch agent
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue