Skip to content

Commit 65fdc6d

Browse files
committed
- display number of files and total size when source file list is greater than 50
1 parent dfc9ddb commit 65fdc6d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

blobporter.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,26 @@ var transferType transfer.Definition
152152
func displayFilesToTransfer(sourcesInfo []pipeline.SourceInfo, numOfBatches int, batchNumber int) {
153153
if numOfBatches == 1 {
154154
fmt.Printf("Files to Transfer (%v) :\n ", transferDefStr)
155+
var totalSize uint64
156+
summary := ""
155157

156158
for _, source := range sourcesInfo {
157159
//if the source is URL, remove the QS
158160
display := source.SourceName
159161
if u, err := url.Parse(source.SourceName); err == nil {
160162
display = fmt.Sprintf("%v%v", u.Hostname(), u.Path)
161163
}
162-
fmt.Printf("Source: %v Size:%v \n", display, source.Size)
164+
summary = summary + fmt.Sprintf("Source: %v Size:%v \n", display, source.Size)
165+
totalSize = totalSize + source.Size
163166
}
164167

168+
if len(sourcesInfo) < 50 {
169+
fmt.Printf(summary)
170+
return
171+
}
172+
173+
fmt.Printf("%v files. Total size:%v\n", len(sourcesInfo), totalSize)
174+
165175
return
166176
}
167177

0 commit comments

Comments
 (0)