Skip to content

Commit

Permalink
chore(release): diable autoupdates for non-github binaries (#1785)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkpattnaik780 authored Dec 9, 2022
1 parent 29a4906 commit 2dcb8dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
type buildSource string

const (
githubBuildSource buildSource = "github"
GithubBuildSource buildSource = "github"
)

// Define public variables here which you wish to be configurable at build time
Expand Down Expand Up @@ -75,7 +75,7 @@ func init() {
// the version currently being used. If so, it logs this information
// to the console.
func CheckForUpdate(ctx context.Context, version string, logger logging.Logger, localizer localize.Localizer) {
if BuildSource != string(githubBuildSource) {
if BuildSource != string(GithubBuildSource) {
return
}
// prefix version with a v to correspond with Git tag
Expand Down
5 changes: 5 additions & 0 deletions pkg/core/cmdutil/selfupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ func DoSelfUpdate(f *factory.Factory) (bool, error) {

// DoSelfUpdate checks for updates once per day and prompts the user to update if there is a newer version available
func DoSelfUpdateOnceADay(f *factory.Factory) (bool, error) {

if build.BuildSource != string(build.GithubBuildSource) {
return false, nil
}

if !f.IOStreams.CanPrompt() {
// Do not prompt if we are not in interactive mode
return false, nil
Expand Down

0 comments on commit 2dcb8dd

Please sign in to comment.