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}}
|
{{end}}{{end}}
|
||||||
`
|
`
|
||||||
|
|
||||||
var (
|
// Git SHA1 commit hash of the release (set via linker flags)
|
||||||
gitCommit string // 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
|
//declare a few constant error messages, useful for later error check comparisons in test
|
||||||
var (
|
var (
|
||||||
|
|
@ -89,6 +90,7 @@ var defaultNodeConfig = node.DefaultConfig
|
||||||
|
|
||||||
// This init function sets defaults so cmd/swarm can run alongside geth.
|
// This init function sets defaults so cmd/swarm can run alongside geth.
|
||||||
func init() {
|
func init() {
|
||||||
|
sv.GitCommit = gitCommit
|
||||||
defaultNodeConfig.Name = clientIdentifier
|
defaultNodeConfig.Name = clientIdentifier
|
||||||
defaultNodeConfig.Version = sv.VersionWithCommit(gitCommit)
|
defaultNodeConfig.Version = sv.VersionWithCommit(gitCommit)
|
||||||
defaultNodeConfig.P2P.ListenAddr = ":30399"
|
defaultNodeConfig.P2P.ListenAddr = ":30399"
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,7 @@ var VersionWithMeta = func() string {
|
||||||
return v
|
return v
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// this variable will be assigned if corresponding parameter is passed with install, but not with test
|
// Git SHA1 commit hash of the release, will be set by main.init() function
|
||||||
// e.g.: go install -ldflags "-X main.gitCommit=ed1312d01b19e04ef578946226e5d8069d5dfd5a" ./cmd/swarm
|
|
||||||
var GitCommit string
|
var GitCommit string
|
||||||
|
|
||||||
// ArchiveVersion holds the textual version string used for Swarm archives.
|
// ArchiveVersion holds the textual version string used for Swarm archives.
|
||||||
|
|
@ -55,7 +54,6 @@ func ArchiveVersion(gitCommit string) string {
|
||||||
}
|
}
|
||||||
if len(gitCommit) >= 8 {
|
if len(gitCommit) >= 8 {
|
||||||
vsn += "-" + gitCommit[:8]
|
vsn += "-" + gitCommit[:8]
|
||||||
GitCommit = gitCommit[:8]
|
|
||||||
}
|
}
|
||||||
return vsn
|
return vsn
|
||||||
}
|
}
|
||||||
|
|
@ -64,7 +62,6 @@ func VersionWithCommit(gitCommit string) string {
|
||||||
vsn := Version
|
vsn := Version
|
||||||
if len(gitCommit) >= 8 {
|
if len(gitCommit) >= 8 {
|
||||||
vsn += "-" + gitCommit[:8]
|
vsn += "-" + gitCommit[:8]
|
||||||
GitCommit = gitCommit[:8]
|
|
||||||
}
|
}
|
||||||
return vsn
|
return vsn
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue