Skip to content

Commit d509b10

Browse files
author
njelich
committed
feat: add disable update subcommand flag
1 parent 6edb719 commit d509b10

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/update.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ var (
5959
githubAPIBase = "https://api.github.com"
6060
download = doDownload
6161
osExecutable = os.Executable
62+
disableUpdateSubcommand = false
6263
)
6364

6465
// semverDiffers reports whether versions a and b differ (ignoring leading 'v').
@@ -505,6 +506,9 @@ then downloads and replaces the current binary.`,
505506
}
506507

507508
func init() {
509+
if disableUpdateSubcommand {
510+
return
511+
}
508512
updateCmd.Flags().AddFlagSet(progress.AnswerYesFlag)
509513
rootCmd.AddCommand(updateCmd)
510514
}

0 commit comments

Comments
 (0)