Skip to content

Commit 9887686

Browse files
authored
Merge pull request #565 from oasisprotocol/njelich/feature/addDisableUpdateFlag
feat: add ability to disable update command for managed installs
2 parents 6edb719 + 82b4a4a commit 9887686

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/update.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ var (
5959
githubAPIBase = "https://api.github.com"
6060
download = doDownload
6161
osExecutable = os.Executable
62+
// DisableUpdateCmd removes the `oasis update` command. This is suitable for environments where the package manager handles updates.
63+
DisableUpdateCmd = "false"
6264
)
6365

6466
// semverDiffers reports whether versions a and b differ (ignoring leading 'v').
@@ -505,6 +507,9 @@ then downloads and replaces the current binary.`,
505507
}
506508

507509
func init() {
510+
if DisableUpdateCmd == "true" {
511+
return
512+
}
508513
updateCmd.Flags().AddFlagSet(progress.AnswerYesFlag)
509514
rootCmd.AddCommand(updateCmd)
510515
}

0 commit comments

Comments
 (0)