Weekend project: OSX launchctl wrapper in Go
I'm a big fan of lunchy, a friendly OSX launchctl wrapper written by Mike Perham, that allows to manage daemon plists with ease. After using it for a long time i decided to rewrite it in Go language. One of the benefits is speed and accessibility. I have a lot or rubies and gemsets on my development machine and using lunchy is actually a pain because its a ruby gem which requires to be installed per gemset or ruby version with RVM.
Go language allows to compile code to a single binary that could simply be dropped into any environment (OSX, Linux, Windows). Its almost the only reason why i started to use Go recently. I wrote a bunch of ruby CLI tools which work on Linux, Mac and Windows and i must say its not easy. With Go you can just compile code and distribute final binary. So one weekend i decided to rewrite lunchy in Go.
- Source code: https://github.com/sosedoff/lunchy-go
- Download a prebuilt binary from Bintray: https://bintray.com/sosedoff/generic/lunchy
Add a new plist:
lunchy install /usr/local/Cellar/redis/2.8.1/homebrew.mxcl.redis.plist
lunchy start redis
lunchy stop redis
lunchy restart redis
lunchy status redis
If you have multiple plists from homebrew, you can simple control all of them:
$ lunchy status
$ lunchy stop homebrew
lunchy show redis
lunchy edit redis
Its pretty fast too.