mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-09 18:28:08 +08:00
Humanize byte size
License: MIT Signed-off-by: Thomas Gardner <tmg@fastmail.com>
This commit is contained in:
parent
f988a54c1b
commit
288f7bc621
@ -6,6 +6,7 @@ import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
humanize "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/dustin/go-humanize"
|
||||
cmds "github.com/ipfs/go-ipfs/commands"
|
||||
corerepo "github.com/ipfs/go-ipfs/core/corerepo"
|
||||
fsrepo "github.com/ipfs/go-ipfs/repo/fsrepo"
|
||||
@ -156,8 +157,8 @@ var repoStatCmd = &cmds.Command{
|
||||
}
|
||||
|
||||
out := fmt.Sprintf(
|
||||
"Path: %s\nSize: %d bytes\nBlocks: %d\n",
|
||||
stat.repoPath, stat.repoSize, stat.numBlocks)
|
||||
"Path: %s\nSize: %s\nBlocks: %d\n",
|
||||
stat.repoPath, humanize.Bytes(stat.repoSize), stat.numBlocks)
|
||||
|
||||
return strings.NewReader(out), nil
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user