https://github.com/micnncim/homebrew-go
Homebrew Go client
https://github.com/micnncim/homebrew-go
Last synced: 2 months ago
JSON representation
Homebrew Go client
- Host: GitHub
- URL: https://github.com/micnncim/homebrew-go
- Owner: micnncim
- Created: 2019-08-22T14:03:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-24T09:27:09.000Z (almost 6 years ago)
- Last Synced: 2024-06-20T01:59:54.551Z (about 1 year ago)
- Language: Go
- Homepage: https://godoc.org/github.com/micnncim/homebrew-go
- Size: 9.77 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# homebrew-go
[![GoDoc][godoc-badge]][godoc]
A Go client package for Homebrew.
## Usage
```
import "github.com/micnncim/homebrew-go"
```## Example
See an [example](./example).
```go
func main() {
stdout := &bytes.Buffer{}
stderr := &bytes.Buffer{}
h := homebrew.New(
homebrew.WithStdout(stdout),
homebrew.WithStderr(stderr),
)ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
defer cancel()
if err := h.Install(ctx, "jq", homebrew.InstallOptionVerbose, homebrew.InstallOptionForce); err != nil {
log.Fatal(err)
}
fmt.Println(stdout.String())
fmt.Println(stderr.String())
}
```## Supported commands
Currently only *essential commands*.
- `brew install [options] formula`
- `brew uninstall, rm, remove [options] formula`
- `brew list, ls [options] [formula]`
- `brew search [options] [text|/text/]`## Dependency
Need to install [Homebrew](https://docs.brew.sh/) to use this package.
## License
MIT
[godoc]: https://godoc.org/github.com/micnncim/homebrew-go
[godoc-badge]: https://img.shields.io/badge/godoc.org-reference-blue.svg