Skip to content

Commit 2dcb8dd

Browse files
chore(release): diable autoupdates for non-github binaries (#1785)
1 parent 29a4906 commit 2dcb8dd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

internal/build/build.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
type buildSource string
1717

1818
const (
19-
githubBuildSource buildSource = "github"
19+
GithubBuildSource buildSource = "github"
2020
)
2121

2222
// Define public variables here which you wish to be configurable at build time
@@ -75,7 +75,7 @@ func init() {
7575
// the version currently being used. If so, it logs this information
7676
// to the console.
7777
func CheckForUpdate(ctx context.Context, version string, logger logging.Logger, localizer localize.Localizer) {
78-
if BuildSource != string(githubBuildSource) {
78+
if BuildSource != string(GithubBuildSource) {
7979
return
8080
}
8181
// prefix version with a v to correspond with Git tag

pkg/core/cmdutil/selfupdate.go

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ func DoSelfUpdate(f *factory.Factory) (bool, error) {
5353

5454
// DoSelfUpdate checks for updates once per day and prompts the user to update if there is a newer version available
5555
func DoSelfUpdateOnceADay(f *factory.Factory) (bool, error) {
56+
57+
if build.BuildSource != string(build.GithubBuildSource) {
58+
return false, nil
59+
}
60+
5661
if !f.IOStreams.CanPrompt() {
5762
// Do not prompt if we are not in interactive mode
5863
return false, nil

0 commit comments

Comments
 (0)