diff --git a/core/commands/repo.go b/core/commands/repo.go index ff4615ef7814..21d6c8e7f0a3 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -105,6 +105,7 @@ set of stored objects and print repo statistics. It outputs to stdout: NumObjects int Number of objects in the local repo. RepoPath string The path to the repo being currently used. RepoSize int Size in bytes that the repo is currently taking. +Version string The repo version `, }, Run: func(req cmds.Request, res cmds.Response) { @@ -147,6 +148,7 @@ RepoSize int Size in bytes that the repo is currently taking. fmt.Fprintf(buf, "RepoSize \t %d\n", stat.RepoSize) } fmt.Fprintf(buf, "RepoPath \t %s\n", stat.RepoPath) + fmt.Fprintf(buf, "Version \t %s\n", stat.Version) return buf, nil }, diff --git a/core/corerepo/stat.go b/core/corerepo/stat.go index 65abf2efd42f..77dcaf6862ee 100644 --- a/core/corerepo/stat.go +++ b/core/corerepo/stat.go @@ -10,6 +10,7 @@ type Stat struct { NumObjects uint64 RepoSize uint64 // size in bytes RepoPath string + Version string } func RepoStat(n *core.IpfsNode, ctx context.Context) (*Stat, error) { @@ -39,5 +40,6 @@ func RepoStat(n *core.IpfsNode, ctx context.Context) (*Stat, error) { NumObjects: count, RepoSize: usage, RepoPath: path, + Version: "fs-repo@" + fsrepo.RepoVersion, }, nil }