Skip to content

Commit

Permalink
Cleanup installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
jschaf committed Mar 20, 2021
1 parent 6d0f117 commit c16cfaa
Showing 1 changed file with 46 additions and 44 deletions.
90 changes: 46 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,55 +152,57 @@ is far more revealing than the pitch.
Precompiled binaries. Change the last line if you want to install somewhere
other than `~/bin/pggen`.

```shell
# MacOS Apple Silicon (arm64)
curl --silent --location --fail https://github.com/jschaf/pggen/releases/latest/download/pggen-darwin-arm64.zip --output "$TMPDIR/pggen.zip" &&
unzip -p "$TMPDIR/pggen.zip" pggen-darwin-arm64 > pggen &&
chmod +x pggen &&
mv pggen ~/bin/pggen
# Make sure pggen works.
pggen gen go --help
```
## Download and extract binary to $PATH

```shell
# MacOS Intel (amd64)
curl --silent --location --fail https://github.com/jschaf/pggen/releases/latest/download/pggen-darwin-amd64.zip --output "$TMPDIR/pggen.zip" &&
unzip -p "$TMPDIR/pggen.zip" pggen-darwin-amd64 > pggen &&
chmod +x pggen &&
mv pggen ~/bin/pggen
# Make sure pggen works.
pggen gen go --help
```
- MacOS Apple Silicon (arm64)

```shell
# Linux (amd64)
curl --silent --location --fail https://github.com/jschaf/pggen/releases/latest/download/pggen-linux-amd64.zip --output "$TMPDIR/pggen.zip" &&
unzip -p "$TMPDIR/pggen.zip" pggen-linux-amd64 > pggen &&
chmod +x pggen &&
mv pggen ~/bin/pggen
# Make sure pggen works.
pggen gen go --help
```
```shell
URL='https://github.com/jschaf/pggen/releases/latest/download/pggen-darwin-arm64.zip' \
curl --silent --location --fail "$URL" --output "$TMPDIR/pggen.zip" &&
unzip -p "$TMPDIR/pggen.zip" pggen-darwin-arm64 > pggen &&
chmod +x pggen &&
mv pggen ~/bin/pggen
```

- MacOS Intel (amd64)

```shell
URL='https://github.com/jschaf/pggen/releases/latest/download/pggen-darwin-amd64.zip' \
curl --silent --location --fail "$URL" --output "$TMPDIR/pggen.zip" &&
unzip -p "$TMPDIR/pggen.zip" pggen-darwin-amd64 > pggen &&
chmod +x pggen &&
mv pggen ~/bin/pggen
```

```shell
# Windows (amd64)
curl --silent --location --fail https://github.com/jschaf/pggen/releases/latest/download/pggen-windows-amd64.zip --output "$TMPDIR/pggen.zip" &&
unzip -p "$TMPDIR/pggen.zip" pggen-windows-amd64.exe > pggen.exe &&
chmod +x pggen.exe &&
mv pggen.exe ~/bin/pggen.exe
# Make sure pggen works.
pggen gen go --help
```
- Linux (amd64)

From source code:
```bash
go get github.com/jschaf/pggen
```shell
URL='https://github.com/jschaf/pggen/releases/latest/download/pggen-linux-amd64.zip' \
curl --silent --location --fail "$URL" --output "$TMPDIR/pggen.zip" &&
unzip -p "$TMPDIR/pggen.zip" pggen-linux-amd64 > pggen &&
chmod +x pggen &&
mv pggen ~/bin/pggen
```

- Windows (amd64)

```shell
URL='https://github.com/jschaf/pggen/releases/latest/download/pggen-windows-amd64.zip' \
curl --silent --location --fail "$URL" --output "$TMPDIR/pggen.zip" &&
unzip -p "$TMPDIR/pggen.zip" pggen-windows-amd64.exe > pggen.exe &&
chmod +x pggen.exe &&
mv pggen.exe ~/bin/pggen.exe
```

- From source code. Requires Go 1.16 because pggen uses `go:embed`.

```shell
go get github.com/jschaf/pggen
```

Make sure pggen works:

# Make sure pggen works.
```bash
pggen gen go --help
```

Expand Down

0 comments on commit c16cfaa

Please sign in to comment.