diff --git a/CHANGELOG.md b/CHANGELOG.md index b5b7491..58b0163 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,18 @@ #Fer + +## [v1.11.0] - 2022-09-05 +### Fixes +- fix panic when latestVersion is empty + +### New Features +- update go.mod & libraries + + ## [v1.10.0] - 2022-02-21 ### New Features -- change deployment tag +- change deploy tag ([#27](https://github.com/kumparan/fer/issues/27)) @@ -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 diff --git a/config/default.go b/config/default.go index 0aa8ab9..d551e63 100644 --- a/config/default.go +++ b/config/default.go @@ -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: diff --git a/config/version.go b/config/version.go index 85659d0..edddbc7 100644 --- a/config/version.go +++ b/config/version.go @@ -1,4 +1,4 @@ package config // Version define version of fer -const Version = "v1.10.0" +const Version = "v1.11.0" diff --git a/console/version.go b/console/version.go index 7d895db..35aeeba 100644 --- a/console/version.go +++ b/console/version.go @@ -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 ( @@ -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) { diff --git a/go.mod b/go.mod index 6c8ee2f..d68a9c2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kumparan/fer -go 1.12 +go 1.18 require ( github.com/blang/semver v3.5.1+incompatible @@ -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 ) diff --git a/go.sum b/go.sum index 323428a..bc2395e 100644 --- a/go.sum +++ b/go.sum @@ -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=