Skip to content

Commit

Permalink
Update instructions to download protoc-gen-twirpy
Browse files Browse the repository at this point in the history
  • Loading branch information
MiLk committed Sep 4, 2024
1 parent c8d4261 commit ca423bf
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,21 @@ pip install twirpy

### Code Generator

You need to install `go` and the `protoc` compiler in your system.
Then, install the `protoc-gen-twirpy` protoc plugin to generate code.
You need to install `protoc`, the Protocol Buffers compiler, and the `protoc-gen-twirpy` protoc plugin to generate code.

First, install the following prerequisites:
- [Go](https://golang.org/): For installation instructions, see [Go’s documentation](https://golang.org/doc/install).
- [Protocol Buffers](https://developers.google.com/protocol-buffers) compiler: For installation instructions, see [Protocol Buffer Compiler Installation documentation](https://github.com/protocolbuffers/protobuf#protobuf-compiler-installation). You can also use your package manager (e.g. `brew install protobuf` on macOS).
First, install the [Protocol Buffers](https://developers.google.com/protocol-buffers) compiler.
For installation instructions, see [Protocol Buffer Compiler Installation documentation](https://github.com/protocolbuffers/protobuf#protobuf-compiler-installation).
You can also use your package manager (e.g. `brew install protobuf` on macOS).

The installed plugin need to be accessible by the protoc compiler.
Set GOBIN (see [go help environment](https://golang.org/cmd/go/#hdr-Environment_variables)) to define where the tool dependencies will be installed.
You might need to add GOBIN to your PATH:
```sh
export GOBIN=$HOME/go/bin
export PATH=$GOBIN:$PATH
```
Go the [releases page](https://github.com/Cryptact/twirpy/releases/latest), and download the `protoc-gen-twirpy` binary for your platform.
Unzip the archive and move the binary to a directory in your PATH.

Then, install the plugin with:
On macOS, you can use the following commands:
```sh
go install github.com/cryptact/twirpy/protoc-gen-twirpy@latest
```
curl -L -o- \
https://github.com/Cryptact/twirpy/releases/latest/download/protoc-gen-twirpy_Darwin_arm64.tar.gz \
| tar xz -C ~/.local/bin protoc-gen-twirpy
````

## Generate and run

Expand Down

0 comments on commit ca423bf

Please sign in to comment.