make download messages less redudant and more simple

This commit is contained in:
Adrien Delorme 2018-08-17 09:29:39 +02:00
parent d7d4aed51c
commit c744e8b2bb
1 changed files with 4 additions and 9 deletions

View File

@ -6,7 +6,6 @@ import (
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"log" "log"
"strings"
"time" "time"
"github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/helper/multistep"
@ -67,7 +66,7 @@ func (s *StepDownload) Run(_ context.Context, state multistep.StateBag) multiste
} }
} }
ui.Say(fmt.Sprintf("Downloading, copying or inplace referencing %s", s.Description)) ui.Say(fmt.Sprintf("Retrieving %s", s.Description))
// First try to use any already downloaded file // First try to use any already downloaded file
// If it fails, proceed to regular download logic // If it fails, proceed to regular download logic
@ -112,14 +111,10 @@ func (s *StepDownload) Run(_ context.Context, state multistep.StateBag) multiste
if finalPath == "" { if finalPath == "" {
for i, url := range s.Url { for i, url := range s.Url {
if strings.HasPrefix(url, "file://") { if s.Inplace {
if s.Inplace { ui.Message(fmt.Sprintf("Using file in-place: %s", url))
ui.Message(fmt.Sprintf("Inplace referencing: %s", url))
} else {
ui.Message(fmt.Sprintf("Copying: %s", url))
}
} else { } else {
ui.Message(fmt.Sprintf("Downloading: %s", url)) ui.Message(fmt.Sprintf("Transferring file from path: %s", url))
} }
config := downloadConfigs[i] config := downloadConfigs[i]