Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
nebojsa94 committed Nov 8, 2018
2 parents 8d5ea0f + 91d54af commit 1d92797
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ changelog:
exclude:
- '^docs:'
- '^test:'
- '^Merge remote-tracking branch'
26 changes: 8 additions & 18 deletions versionCheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,23 @@ import (
"math/rand"
"net/http"
"sort"
"time"
)

type commit struct {
Sha string `json:"sha"`
Url string `json:"url"`
}

type tagResults struct {
Name string `json:"name"`
ZipballUrl string `json:"zipball_url"`
TarballUrl string `json:"tarball_url"`
Commit commit `json:"commit"`
NodeId string `json:"node_id"`
type releaseResult struct {
Name string `json:"name"`
NodeId string `json:"node_id"`
}

func MaybeCheckVersion() {
rand.Seed(time.Now().UnixNano())
randInt := rand.Intn(25)

if randInt != 24 {
return
}

response, err := http.Get("https://api.github.com/repos/tenderly/tenderly-cli/tags")
response, err := http.Get("https://api.github.com/repos/tenderly/tenderly-cli/releases")

if err != nil {
return
Expand All @@ -44,14 +38,10 @@ func MaybeCheckVersion() {
return
}

var result []tagResults
var result []releaseResult
err = json.Unmarshal(contents, &result)

if err != nil {
return
}

if len(result) == 0 {
if err != nil || len(result) == 0 {
return
}

Expand Down

0 comments on commit 1d92797

Please sign in to comment.