diff --git a/internal/build/build.go b/internal/build/build.go index 5e0532c5b..cc430ab53 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -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 @@ -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 diff --git a/pkg/core/cmdutil/selfupdate.go b/pkg/core/cmdutil/selfupdate.go index ae97a773e..82b53b435 100644 --- a/pkg/core/cmdutil/selfupdate.go +++ b/pkg/core/cmdutil/selfupdate.go @@ -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