Skip to content

Commit

Permalink
v20220601
Browse files Browse the repository at this point in the history
  • Loading branch information
txthinking committed May 27, 2022
1 parent 102dd79 commit 71a2413
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,19 @@ func main() {
app.Before = func(*cli.Context) error {
res, err := http.Get("https://api.github.com/repos/txthinking/nami/releases/latest")
if err != nil {
return err
log.Println("Check nami version", err)
return nil
}
defer res.Body.Close()
j, err := simplejson.NewFromReader(res.Body)
if err != nil {
return err
log.Println("Check nami version", err)
return nil
}
s, err := j.Get("tag_name").String()
if err != nil {
return err
log.Println("Check nami version", err)
return nil
}
if s > "v20220601" {
return errors.New("New version: " + s + ", please upgrade nami first: $ nami install nami")
Expand Down

0 comments on commit 71a2413

Please sign in to comment.