File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 44 "encoding/json"
55 "fmt"
66 "net/http"
7+ "os"
78 "strings"
89
910 "github.com/blang/semver"
@@ -15,8 +16,9 @@ import (
1516var Version = "3.9.1"
1617
1718// PrintVersion prints the current version of sops. If the flag
18- // `--disable-version-check` is set, the function will not attempt
19- // to retrieve the latest version from the GitHub API.
19+ // `--disable-version-check` is set or if the environment variable
20+ // SOPS_DISABLE_VERSION_CHECK has any value, the function will not
21+ // attempt to retrieve the latest version from the GitHub API.
2022//
2123// If the flag is not set, the function will attempt to retrieve
2224// the latest version from the GitHub API and compare it to the
@@ -27,7 +29,7 @@ func PrintVersion(c *cli.Context) {
2729
2830 out .WriteString (fmt .Sprintf ("%s %s" , c .App .Name , c .App .Version ))
2931
30- if c .Bool ("disable-version-check" ) {
32+ if c .Bool ("disable-version-check" ) || os . Getenv ( "SOPS_DISABLE_VERSION_CHECK" ) != "" {
3133 out .WriteString ("\n " )
3234 } else {
3335 upstreamVersion , upstreamURL , err := RetrieveLatestReleaseVersion ()
You can’t perform that action at this time.
0 commit comments