Switch to axllent/ghru

This commit is contained in:
Ralph Slooten 2019-11-03 19:12:02 +13:00
parent 7ffb944b0f
commit 8c3e478384
5 changed files with 11 additions and 9 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
/dist/
goptimize
goptimize*

View File

@ -5,7 +5,7 @@ LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}"
build = echo "\n\nBuilding $(1)-$(2)" && GOOS=$(1) GOARCH=$(2) go build ${LDFLAGS} -o dist/goptimize_${VERSION}_$(1)_$(2) \
&& bzip2 dist/goptimize_${VERSION}_$(1)_$(2)
goptimize: *.go
goptimize: *.go go.*
go build ${LDFLAGS} -o goptimize
rm -rf /tmp/go-*

2
go.mod
View File

@ -3,7 +3,7 @@ module github.com/axllent/goptimize
go 1.13
require (
github.com/axllent/gitrel v0.0.0-20190920100556-8fb3317ae1cd
github.com/axllent/ghru v1.1.3
github.com/disintegration/imaging v1.6.1
github.com/spf13/pflag v1.0.5
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8

6
go.sum
View File

@ -1,5 +1,7 @@
github.com/axllent/gitrel v0.0.0-20190920100556-8fb3317ae1cd h1:cJgMzRxCEzJiI95DxIOgrpCxwBqcUQU0foCuGTB1F4o=
github.com/axllent/gitrel v0.0.0-20190920100556-8fb3317ae1cd/go.mod h1:p7Ab0oyyqKbcVmclkdRR9+pw8b5RZlMlDXQ6iplJiQ4=
github.com/axllent/ghru v1.1.3 h1:n0jYsuqCYaHHAR6DraXZl8hpBY4j0XV47y5Lyym/jGo=
github.com/axllent/ghru v1.1.3/go.mod h1:rFvMhcO1UAv2Cv6bXscS8EOc7qqNpfe8ZLp23utzs88=
github.com/axllent/semver v0.0.0-20191103011746-394cefa91ee9 h1:LHNcCfePzgC/agAJs5a/5K3hFo8uW04bEdDKDkoX4do=
github.com/axllent/semver v0.0.0-20191103011746-394cefa91ee9/go.mod h1:2xSPzvG8n9mRfdtxSvWvfTfQGWfHsMsHO1iZnKATMSc=
github.com/disintegration/imaging v1.6.1 h1:JnBbK6ECIZb1NsWIikP9pd8gIlTIRx7fuDNpU9fsxOE=
github.com/disintegration/imaging v1.6.1/go.mod h1:xuIt+sRxDFrHS0drzXUlCJthkJ8k7lkkUojDSR247MQ=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=

View File

@ -7,7 +7,7 @@ import (
"regexp"
"strconv"
"github.com/axllent/gitrel"
"github.com/axllent/ghru"
"github.com/spf13/pflag"
)
@ -87,15 +87,15 @@ func main() {
if showversion {
fmt.Println(fmt.Sprintf("Version: %s", version))
latest, _, _, err := gitrel.Latest("axllent/goptimize", "goptimize")
if err == nil && latest != version {
latest, _, _, err := ghru.Latest("axllent/goptimize", "goptimize")
if err == nil && ghru.GreaterThan(latest, version) {
fmt.Printf("Update available: %s\nRun `%s -u` to update.\n", latest, os.Args[0])
}
return
}
if update {
rel, err := gitrel.Update("axllent/goptimize", "goptimize", version)
rel, err := ghru.Update("axllent/goptimize", "goptimize", version)
if err != nil {
fmt.Println(err)
os.Exit(1)