mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-07 21:37:04 +09:00
GO-2835 fix vcs info on gomobile
This commit is contained in:
parent
6f70547023
commit
a64abc85b3
1 changed files with 9 additions and 1 deletions
|
@ -8,7 +8,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
GitBranch, GitSummary string
|
||||
GitBranch, GitSummary, BuildDate, GitCommit string
|
||||
)
|
||||
|
||||
type VCSInfo struct {
|
||||
|
@ -62,6 +62,14 @@ func GetVCSInfo() VCSInfo {
|
|||
Summary: GitSummary,
|
||||
CGO: true,
|
||||
}
|
||||
// we don't have a build date and commit in the gomobile builds, so inject it via linker flags
|
||||
if BuildDate != "" {
|
||||
info.BuildDate, _ = time.Parse(time.RFC3339, BuildDate)
|
||||
}
|
||||
if GitCommit != "" {
|
||||
info.Revision = GitCommit
|
||||
}
|
||||
|
||||
d, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return info
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue