Skip to content

Commit

Permalink
fix(version): allow users to disable version check via environment va…
Browse files Browse the repository at this point in the history
…riable

Signed-off-by: Nicklas Frahm <[email protected]>
  • Loading branch information
nicklasfrahm committed Nov 24, 2024
1 parent 222a7f7 commit 07f07cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"os"
"strings"

"github.com/blang/semver"
Expand All @@ -27,7 +28,7 @@ func PrintVersion(c *cli.Context) {

out.WriteString(fmt.Sprintf("%s %s", c.App.Name, c.App.Version))

if c.Bool("disable-version-check") {
if c.Bool("disable-version-check") || os.Getenv("SOPS_DISABLE_VERSION_CHECK") != "" {
out.WriteString("\n")
} else {
upstreamVersion, upstreamURL, err := RetrieveLatestReleaseVersion()
Expand Down

0 comments on commit 07f07cc

Please sign in to comment.