From 605e4fb65382e1b7e9dfb1e4275c55bf19d67f0a Mon Sep 17 00:00:00 2001 From: 9547 Date: Mon, 22 Feb 2021 01:20:45 +0800 Subject: [PATCH] tiup: install --force to reinstall --- cmd/install.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/install.go b/cmd/install.go index 37fb108d8f..3dcd58ab64 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -19,6 +19,7 @@ import ( ) func newInstallCmd() *cobra.Command { + var force bool cmd := &cobra.Command{ Use: "install [:version] [component2...N]", Short: "Install a specific version of a component", @@ -36,12 +37,9 @@ of the same component: if len(args) == 0 { return cmd.Help() } - return installComponents(env, args) + return env.UpdateComponents(args, false, force) }, } + cmd.Flags().BoolVar(&force, "force", false, "If the specified version was already installed, force a reinstallation") return cmd } - -func installComponents(env *environment.Environment, specs []string) error { - return env.UpdateComponents(specs, false, false) -}