diff --git a/cmd/get.go b/cmd/get.go index 9ba5225..ffbcce4 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -105,7 +105,6 @@ func (o *downloadOption) preRunE(cmd *cobra.Command, args []string) (err error) return } o.name = ins.Name - cmd.Printf("start to download from %s\n", targetURL) } o.URL = targetURL @@ -139,6 +138,7 @@ func (o *downloadOption) runE(cmd *cobra.Command, args []string) (err error) { return } + cmd.Printf("start to download from %s\n", o.URL) if o.Thread <= 1 { err = pkg.DownloadWithContinue(o.URL, o.Output, o.ContinueAt, -1, 0, o.ShowProgress) } else { diff --git a/cmd/install.go b/cmd/install.go index 1c25aa0..81547f0 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -1,7 +1,6 @@ package cmd import ( - "fmt" "github.com/linuxsuren/http-downloader/pkg/installer" "github.com/spf13/cobra" "runtime" @@ -70,7 +69,6 @@ func (o *installOption) runE(cmd *cobra.Command, args []string) (err error) { Output: o.Output, CleanPackage: o.CleanPackage, } - fmt.Println(process) err = process.Install() return } diff --git a/pkg/installer/check.go b/pkg/installer/check.go index 5a1c8ca..f713d63 100644 --- a/pkg/installer/check.go +++ b/pkg/installer/check.go @@ -93,7 +93,7 @@ func (o *Installer) ProviderURLParse(path string, acceptPreRelease bool) (url st } } - fmt.Printf("prepare to download %s/%s\n", org, repo) + fmt.Printf("target package is %s/%s\n", org, repo) } else { err = fmt.Errorf("only support format xx, xx/xx or xx/xx/xx") return @@ -120,11 +120,13 @@ func (o *Installer) ProviderURLParse(path string, acceptPreRelease bool) (url st } o.Name = name - // fetch the latest config - fmt.Println("start to fetch the config") - if err = FetchConfig(); err != nil { - err = fmt.Errorf("unable to fetch the latest config, error: %v", err) - return + if o.Fetch { + // fetch the latest config + fmt.Println("start to fetch the config") + if err = FetchConfig(); err != nil { + err = fmt.Errorf("unable to fetch the latest config, error: %v", err) + return + } } // try to parse from config