From a5587e30ec55e81b0ac373b50900ce73dd7ca5bc Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 20 Aug 2018 11:38:41 +0200 Subject: [PATCH] log wether the file was transfered or is just being inplace referenced --- common/step_download.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/common/step_download.go b/common/step_download.go index 03340b974..1719c5987 100644 --- a/common/step_download.go +++ b/common/step_download.go @@ -61,7 +61,7 @@ func (s *StepDownload) Run(_ context.Context, state multistep.StateBag) multiste } } - ui.Say(fmt.Sprintf("Downloading or copying %s", s.Description)) + ui.Say(fmt.Sprintf("Retrieving %s", s.Description)) // First try to use any already downloaded file // If it fails, proceed to regular download logic @@ -104,9 +104,7 @@ func (s *StepDownload) Run(_ context.Context, state multistep.StateBag) multiste } if finalPath == "" { - for i, url := range s.Url { - ui.Message(fmt.Sprintf("Downloading or copying: %s", url)) - + for i := range s.Url { config := downloadConfigs[i] path, err, retry := s.download(config, state) @@ -159,6 +157,11 @@ func (s *StepDownload) download(config *DownloadConfig, state multistep.StateBag if err != nil { return "", err, true } + if download.config.CopyFile { + ui.Message(fmt.Sprintf("Transferred: %s", config.Url)) + } else { + ui.Message(fmt.Sprintf("Using file in-place: %s", config.Url)) + } return path, nil, true case <-progressTicker.C: