Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
README: fix installation instructions
Browse files Browse the repository at this point in the history
Encouraging people to clone the repo means they won't get a sensible
tagged version. Instead, use the "hack" of creating a temporary module,
adding github.com/myitcv/gobin as a dependency via go get, then using go
install. The logic in go get will use the latest tagged version.

Also bump to v1.0.0 of go-internal and myitcv.io@latest in the process.
  • Loading branch information
myitcv committed Oct 25, 2018
1 parent 25678ef commit d4d0c72
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 38 deletions.
11 changes: 4 additions & 7 deletions .installation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@ git config --global push.default current

# block: clone
export GO111MODULE=on
git clone https://github.com/myitcv/gobin /tmp/gobin
cd /tmp/gobin
cd $(mktemp -d)
go mod init mod
go get -m github.com/myitcv/gobin

# block: install
go install
go install github.com/myitcv/gobin

# block: fix path
export PATH=$(go env GOPATH)/bin:$PATH
which gobin

# block: use
gobin -r github.com/rogpeppe/gohack@master -help
assert "$? -eq 2" $LINENO
32 changes: 9 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ The gobin command installs/runs main packages.

<!-- __JSON: go run github.com/myitcv/gobin -m -r myitcv.io/cmd/egrunner .installation.sh # LONG ONLINE
Clone the `gobin` repo:
Use a temporary module to get the latest version of `github.com/myitcv/gobin`:
```
{{PrintBlock "clone" -}}
{{PrintBlock "clone" | lineEllipsis 5 -}}
```
Install:
Expand All @@ -30,27 +30,23 @@ Update your `PATH` and verify we can find `gobin` in our new `PATH`:
{{PrintBlock "fix path" -}}
```
Use `gobin` as a "test":
```
{{PrintBlock "use" | lineEllipsis 4 -}}
```
-->

Clone the `gobin` repo:
Use a temporary module to get the latest version of `github.com/myitcv/gobin`:

```
$ export GO111MODULE=on
$ git clone https://github.com/myitcv/gobin /tmp/gobin
Cloning into '/tmp/gobin'...
$ cd /tmp/gobin
$ cd $(mktemp -d)
$ go mod init mod
go: creating new go.mod: module mod
$ go get -m github.com/myitcv/gobin
...
```

Install:

```
$ go install
$ go install github.com/myitcv/gobin
...
```

Expand All @@ -62,16 +58,6 @@ $ which gobin
/home/gopher/gopath/bin/gobin
```

Use `gobin` as a "test":

```
$ gobin -r github.com/rogpeppe/gohack@master -help
The gohack command checks out Go module dependencies
into a directory where they can be edited, and adjusts
the go.mod file appropriately.
...
```

<!-- END -->

### Examples
Expand Down
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/myitcv/gobin

require (
github.com/rogpeppe/go-internal v1.0.0-alpha
myitcv.io v0.0.0-20181024001312-926e6775fd21
github.com/rogpeppe/go-internal v1.0.0
myitcv.io v0.0.0-20181024170518-69843ea77cfd
)

replace github.com/rogpeppe/go-internal => github.com/myitcv/go-internal v1.0.0-alpha.0.20181023085657-b3919076a82e
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/myitcv/go-internal v1.0.0-alpha.0.20181023085657-b3919076a82e h1:DdePa8RW95raZ79rL4AU915Lpdyz8FmStI+ng+Hf7Ls=
github.com/myitcv/go-internal v1.0.0-alpha.0.20181023085657-b3919076a82e/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/rogpeppe/go-internal v1.0.0 h1:o4VLZ5jqHE+HahLT6drNtSGTrrUA3wPBmtpgqtdbClo=
github.com/rogpeppe/go-internal v1.0.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/russross/blackfriday v1.5.1/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -47,5 +47,5 @@ honnef.co/go/js/util v0.0.0-20150216223935-96b8dd9d1621/go.mod h1:WrAIh8rWfzvMdL
honnef.co/go/js/xhr v0.0.0-20150307031022-00e3346113ae/go.mod h1:QwoYXdHZpuR080H32s5jqyk7zh/k/U9bDFg2g8OMmOM=
mvdan.cc/sh v2.5.0+incompatible h1:JNM6l18iQFGZl0dK2n/7Z85sNaFq9zSl3qooNNyl+qA=
mvdan.cc/sh v2.5.0+incompatible/go.mod h1:IeeQbZq+x2SUGBensq/jge5lLQbS3XT2ktyp3wrt4x8=
myitcv.io v0.0.0-20181024001312-926e6775fd21 h1:OHvJTKuOUN+9gMs9zy8NJL6d+Yob+yiKOX14mJO/ifs=
myitcv.io v0.0.0-20181024001312-926e6775fd21/go.mod h1:0yVf2bHw6qSFxyjj1hJ+yA68GjlMIr6FZcQgBG9Cqq0=
myitcv.io v0.0.0-20181024170518-69843ea77cfd h1:wJZBNGj4rAqFC7Uvj8qeJ8rBKfhbvj47g/0wkN5R0Ew=
myitcv.io v0.0.0-20181024170518-69843ea77cfd/go.mod h1:0yVf2bHw6qSFxyjj1hJ+yA68GjlMIr6FZcQgBG9Cqq0=

0 comments on commit d4d0c72

Please sign in to comment.