Skip to content

Commit 94d125c

Browse files
committed
chore(volumes): unified in bytes
1 parent 08618f6 commit 94d125c

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

cmd/volumes.go

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"os"
99
"path"
1010
"regexp"
11-
"strconv"
1211
"strings"
1312
"time"
1413

@@ -259,25 +258,10 @@ func (d *DryccCmd) volumesClientLs(appID, vol string) error {
259258

260259
table := d.getDefaultFormatTable([]string{})
261260
for _, dir := range dirs {
262-
var size string
263-
s, err := strconv.ParseInt(dir.Size, 10, 64)
264-
if err != nil {
265-
return err
266-
}
267261
if dir.Type == "dir" {
268-
s = 4096
269262
dir.Name = fmt.Sprintf("%s/", dir.Name)
270263
}
271-
if s > 1024 {
272-
size = fmt.Sprintf("%dKiB", s/1024)
273-
} else if s > 1024*1024 {
274-
size = fmt.Sprintf("%dMiB", s/(1024*1024))
275-
} else if s > 1024*1024*1024 {
276-
size = fmt.Sprintf("%dGiB", s/(1024*1024*1024))
277-
} else {
278-
size = fmt.Sprintf("%d", s)
279-
}
280-
table.Append([]string{fmt.Sprintf("[%s]", d.formatTime(dir.Timestamp)), size, dir.Name})
264+
table.Append([]string{fmt.Sprintf("[%s]", d.formatTime(dir.Timestamp)), dir.Size, dir.Name})
281265
}
282266
table.Render()
283267
return nil

0 commit comments

Comments
 (0)