Skip to content

Commit

Permalink
feat(daemon): print version
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
  • Loading branch information
overbool committed Sep 20, 2018
1 parent 987fef1 commit e13abfa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/ipfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import (
"net/http"
_ "net/http/pprof"
"os"
"runtime"
"sort"
"sync"

version "github.com/ipfs/go-ipfs"
utilmain "github.com/ipfs/go-ipfs/cmd/ipfs/util"
oldcmds "github.com/ipfs/go-ipfs/commands"
"github.com/ipfs/go-ipfs/core"
Expand Down Expand Up @@ -191,6 +193,11 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
log.Errorf("Injecting prometheus handler for metrics failed with message: %s\n", err.Error())
}

// print the ipfs version
fmt.Printf("go-ipfs version: %s\n"+
"Repo version: %d\nSystem version: %s\nGolang version: %s\n",
version.CurrentVersionNumber, fsrepo.RepoVersion, runtime.GOARCH+"/"+runtime.GOOS, runtime.Version())

// let the user know we're going.
fmt.Printf("Initializing daemon...\n")

Expand Down

0 comments on commit e13abfa

Please sign in to comment.