mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
swarm/version: fixed gitCommit variable
This commit is contained in:
parent
3d6f32bbd8
commit
652395195d
2 changed files with 6 additions and 7 deletions
|
|
@ -66,9 +66,10 @@ OPTIONS:
|
|||
{{end}}{{end}}
|
||||
`
|
||||
|
||||
var (
|
||||
gitCommit string // Git SHA1 commit hash of the release (set via linker flags)
|
||||
)
|
||||
// Git SHA1 commit hash of the release (set via linker flags)
|
||||
// this variable will be assigned if corresponding parameter is passed with install, but not with test
|
||||
// e.g.: go install -ldflags "-X main.gitCommit=ed1312d01b19e04ef578946226e5d8069d5dfd5a" ./cmd/swarm
|
||||
var gitCommit string
|
||||
|
||||
//declare a few constant error messages, useful for later error check comparisons in test
|
||||
var (
|
||||
|
|
@ -89,6 +90,7 @@ var defaultNodeConfig = node.DefaultConfig
|
|||
|
||||
// This init function sets defaults so cmd/swarm can run alongside geth.
|
||||
func init() {
|
||||
sv.GitCommit = gitCommit
|
||||
defaultNodeConfig.Name = clientIdentifier
|
||||
defaultNodeConfig.Version = sv.VersionWithCommit(gitCommit)
|
||||
defaultNodeConfig.P2P.ListenAddr = ":30399"
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ var VersionWithMeta = func() string {
|
|||
return v
|
||||
}()
|
||||
|
||||
// this variable will be assigned if corresponding parameter is passed with install, but not with test
|
||||
// e.g.: go install -ldflags "-X main.gitCommit=ed1312d01b19e04ef578946226e5d8069d5dfd5a" ./cmd/swarm
|
||||
// Git SHA1 commit hash of the release, will be set by main.init() function
|
||||
var GitCommit string
|
||||
|
||||
// ArchiveVersion holds the textual version string used for Swarm archives.
|
||||
|
|
@ -55,7 +54,6 @@ func ArchiveVersion(gitCommit string) string {
|
|||
}
|
||||
if len(gitCommit) >= 8 {
|
||||
vsn += "-" + gitCommit[:8]
|
||||
GitCommit = gitCommit[:8]
|
||||
}
|
||||
return vsn
|
||||
}
|
||||
|
|
@ -64,7 +62,6 @@ func VersionWithCommit(gitCommit string) string {
|
|||
vsn := Version
|
||||
if len(gitCommit) >= 8 {
|
||||
vsn += "-" + gitCommit[:8]
|
||||
GitCommit = gitCommit[:8]
|
||||
}
|
||||
return vsn
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue