Skip to content

Commit

Permalink
version: don't print 'VERSION-' if no commit is specified
Browse files Browse the repository at this point in the history
fixes #6022
  • Loading branch information
Stebalien committed Aug 28, 2019
1 parent 32d54a0 commit 955b8a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,11 @@ func YesNoPrompt(prompt string) bool {
}

func printVersion() {
fmt.Printf("go-ipfs version: %s-%s\n", version.CurrentVersionNumber, version.CurrentCommit)
v := version.CurrentVersionNumber
if version.CurrentCommit != "" {
v += "-" + version.CurrentCommit
}
fmt.Printf("go-ipfs version: %s\n", v)
fmt.Printf("Repo version: %d\n", fsrepo.RepoVersion)
fmt.Printf("System version: %s\n", runtime.GOARCH+"/"+runtime.GOOS)
fmt.Printf("Golang version: %s\n", runtime.Version())
Expand Down
3 changes: 2 additions & 1 deletion core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ package core
import (
"context"
"io"
"path"

"github.com/ipfs/go-filestore"
version "github.com/ipfs/go-ipfs"
Expand Down Expand Up @@ -54,7 +55,7 @@ import (
var log = logging.Logger("core")

func init() {
identify.ClientVersion = "go-ipfs/" + version.CurrentVersionNumber + "/" + version.CurrentCommit
identify.ClientVersion = path.Join("go-ipfs", version.CurrentVersionNumber, version.CurrentCommit)
}

// IpfsNode is IPFS Core module. It represents an IPFS instance.
Expand Down

0 comments on commit 955b8a5

Please sign in to comment.