Skip to content

Commit

Permalink
fix: find major version.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Dec 3, 2020
1 parent 51d9e34 commit 4d7c34d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.PHONY: clean check test build fmt

GOFILES := $(shell git ls-files '*.go' | grep -v '^vendor/')
.PHONY: clean check test build

TAG_NAME := $(shell git tag -l --contains HEAD)
SHA := $(shell git rev-parse --short HEAD)
Expand All @@ -21,6 +19,3 @@ build: clean

check:
golangci-lint run

fmt:
@gofmt -s -l -w $(GOFILES)
10 changes: 5 additions & 5 deletions updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,21 @@ func Test_guessVersion(t *testing.T) {
},
},
{
desc: "",
desc: "latest major (go-github)",
baseModuleName: "github.com/google/go-github",
raw: "latest",
expected: expected{
Major: "v32",
Full: "v32.1.0",
Major: "v33",
Full: "v33.0.0",
},
},
{
desc: "",
desc: "latest major (backoff)",
baseModuleName: "github.com/cenkalti/backoff",
raw: "latest",
expected: expected{
Major: "v4",
Full: "v4.0.2",
Full: "v4.1.0",
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion upgrader.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func findHighestFromGoPkg(lib string) (string, error) {
return "", err
}

compile := cascadia.MustCompile("html body.Site main.Site-content div.Container header.DetailsHeader div.DetailsHeader-banner p a")
compile := cascadia.MustCompile("html body.Site.Site--wide main.Site-content div.Container header.UnitHeader div.UnitHeader-container div.UnitHeader-versionBanner span a")

node := cascadia.Query(doc, compile)
if node != nil && node.FirstChild != nil {
Expand Down

0 comments on commit 4d7c34d

Please sign in to comment.