Commit 367101b 1 parent 408dc02 commit 367101b Copy full SHA for 367101b
File tree 1 file changed +12
-13
lines changed
1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -18,20 +18,19 @@ func PrintVersion(c *cli.Context) {
18
18
out := fmt .Sprintf ("%s %s" , c .App .Name , c .App .Version )
19
19
if c .Bool ("disable-version-check" ) {
20
20
out += "\n "
21
+ } else {upstreamVersion , err := RetrieveLatestVersionFromUpstream ()
22
+ if err != nil {
23
+ out += fmt .Sprintf ("\n [warning] failed to retrieve latest version from upstream: %v\n " , err )
24
+ }
25
+ outdated , err := AIsNewerThanB (upstreamVersion , Version )
26
+ if err != nil {
27
+ out += fmt .Sprintf ("\n [warning] failed to compare current version with latest: %v\n " , err )
21
28
} else {
22
- upstreamVersion , err := RetrieveLatestVersionFromUpstream ()
23
- if err != nil {
24
- out += fmt .Sprintf ("\n [warning] failed to retrieve latest version from upstream: %v\n " , err )
25
- }
26
- outdated , err := AIsNewerThanB (upstreamVersion , Version )
27
- if err != nil {
28
- out += fmt .Sprintf ("\n [warning] failed to compare current version with latest: %v\n " , err )
29
- }
30
- if outdated {
31
- out += fmt .Sprintf ("\n [info] sops %s is available, update with `go get -u github.com/getsops/sops/v3/cmd/sops`\n " , upstreamVersion )
32
- } else {
33
- out += " (latest)\n "
34
- }
29
+ if outdated {
30
+ out += fmt .Sprintf ("\n [info] sops %s is available, update with `go get -u github.com/getsops/sops/v3/cmd/sops`\n " , upstreamVersion )
31
+ } else {
32
+ out += " (latest)\n "
33
+ }
35
34
}
36
35
fmt .Fprintf (c .App .Writer , "%s" , out )
37
36
}
You can’t perform that action at this time.
0 commit comments