A library for easily creating launch agent files to autorun your applications in macOS.
- Easy interface
- Pure Golang
- Safe
Run command at your project directory.
go get -u github.com/mishamyrt/go-lunch
Create Agent
instance with required fields: PackageName
, Command
, Path
. For path you can use UserPath
and SharedPath
helpers. It returns launch agent path.
package main
import "github.com/mishamyrt/go-lunch"
const packageName = "com.domain.my-app"
func main() {
path, _ := lunch.UserPath(packageName)
agent := lunch.Agent{
PackageName: packageName,
Command: "/usr/local/bin/my-app run -d",
Path: path,
}
agent.Write()
}
PackageName
- App package nameKeepAlive
- Restart app on exitCommand
- App start commandStandardOutPath
- App stdout. Defaults to /dev/nullStandardErrorPath
- App stderr. Defaults to /dev/nullPath
- Launch Agent path