From 2dcb8dd1b2b13f35abef89445e6adf4c959a2a7c Mon Sep 17 00:00:00 2001 From: Ramakrishna Pattnaik Date: Fri, 9 Dec 2022 11:25:52 +0530 Subject: [PATCH] chore(release): diable autoupdates for non-github binaries (#1785) --- internal/build/build.go | 4 ++-- pkg/core/cmdutil/selfupdate.go | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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