Skip to content

Commit

Permalink
feature: update go.mod & libraries (#28)
Browse files Browse the repository at this point in the history
* feature: update go.mod & libraries

* bump: update changelog and version

* bugfix: fix panic when latestVersion is empty

* bump: changelog

Co-authored-by: Frederich Blessy <[email protected]>
  • Loading branch information
notblessy and Frederich Blessy authored Sep 5, 2022
1 parent 5b78b6a commit 3d3c406
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 21 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#Fer

<a name="v1.11.0"></a>
## [v1.11.0] - 2022-09-05
### Fixes
- fix panic when latestVersion is empty

### New Features
- update go.mod & libraries


<a name="v1.10.0"></a>
## [v1.10.0] - 2022-02-21
### New Features
- change deployment tag
- change deploy tag ([#27](https://github.com/kumparan/fer/issues/27))


<a name="v1.9.0"></a>
Expand Down Expand Up @@ -141,7 +150,8 @@
- db migrationfile generator ([#3](https://github.com/kumparan/fer/issues/3))


[Unreleased]: https://github.com/kumparan/fer/compare/v1.10.0...HEAD
[Unreleased]: https://github.com/kumparan/fer/compare/v1.11.0...HEAD
[v1.11.0]: https://github.com/kumparan/fer/compare/v1.10.0...v1.11.0
[v1.10.0]: https://github.com/kumparan/fer/compare/v1.9.0...v1.10.0
[v1.9.0]: https://github.com/kumparan/fer/compare/v1.8.1...v1.9.0
[v1.8.1]: https://github.com/kumparan/fer/compare/v1.8.0...v1.8.1
Expand Down
2 changes: 1 addition & 1 deletion config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

const (
// GoVersion :nodoc:
GoVersion = "1.12.7"
GoVersion = "1.18.0"
// ChangeLogInstallerURL :nodoc:
ChangeLogInstallerURL = "github.com/git-chglog/git-chglog/cmd/git-chglog"
// ProtobufInstallerURL :nodoc:
Expand Down
2 changes: 1 addition & 1 deletion config/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package config

// Version define version of fer
const Version = "v1.10.0"
const Version = "v1.11.0"
29 changes: 19 additions & 10 deletions console/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package console
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"path/filepath"

"github.com/blang/semver"
"github.com/kumparan/fer/cache"
"github.com/kumparan/fer/config"
"github.com/spf13/cobra"
"io/ioutil"
"net/http"
"path/filepath"
)

const (
Expand Down Expand Up @@ -81,18 +82,26 @@ func getFerLatestVersionCached() (ver string, err error) {
}

func checkVersion() {
latestVer, err := getFerLatestVersionCached()
if err != nil {
PrintWarn("Error getting latest version: %s\n", err.Error())
}
currentVersion, err := semver.Make(config.Version[1:])
currentVersion, err := semver.ParseTolerant(config.Version)
if err != nil {
PrintWarn("Error parsing current version: %s\n", err.Error())
return
}
latestVersion, err := semver.Make(latestVer[1:])

latestVer, err := getFerLatestVersionCached()
if err != nil {
PrintWarn("Error parsing latest version: %s\n", err.Error())
PrintWarn("Error getting latest version: %s\n", err.Error())
}

var latestVersion semver.Version
switch latestVer {
case "":
PrintWarn("Error parsing latest version empty\n")
default:
latestVersion, err = semver.ParseTolerant(latestVer)
if err != nil {
PrintWarn("Error parsing latest version: %s\n", err.Error())
}
}

if currentVersion.LT(latestVersion) {
Expand Down
24 changes: 17 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/kumparan/fer

go 1.12
go 1.18

require (
github.com/blang/semver v3.5.1+incompatible
Expand All @@ -9,18 +9,28 @@ require (
github.com/gookit/color v1.2.0
github.com/hashicorp/go-version v1.2.0
github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365
github.com/kr/pretty v0.1.0 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.10 // indirect
github.com/olekukonko/tablewriter v0.0.4
github.com/sirupsen/logrus v1.5.0
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.4.0
golang.org/x/sys v0.0.0-20191009170203-06d7bd2c5f4f // indirect
gopkg.in/djherbis/fscache.v0 v0.9.0
)

require (
github.com/VividCortex/ewma v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.7.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.10 // indirect
github.com/mattn/go-runewidth v0.0.7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/djherbis/atime.v1 v1.0.0 // indirect
gopkg.in/djherbis/fscache.v0 v0.9.0
gopkg.in/djherbis/stream.v1 v1.2.0 // indirect
gopkg.in/yaml.v2 v2.2.4 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191009170203-06d7bd2c5f4f h1:hjzMYz/7Ea1mNKfOnFOfktR0mlA5jqhvywClCMHM/qw=
golang.org/x/sys v0.0.0-20191009170203-06d7bd2c5f4f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY=
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
Expand Down

0 comments on commit 3d3c406

Please sign in to comment.