diff --git a/core/info.go b/core/info.go index d28ac3c..f9c8be5 100644 --- a/core/info.go +++ b/core/info.go @@ -9,7 +9,7 @@ func GetRevInfo() (rev string) { if setting.Key == "vcs.revision" { rev = setting.Value + rev } - if setting.Key == "vcs.modified" { + if setting.Key == "vcs.modified" && setting.Value == "true" { rev = rev + "-dirty" } } diff --git a/web/root.go b/web/root.go index 508b01c..a0a10aa 100644 --- a/web/root.go +++ b/web/root.go @@ -2,7 +2,6 @@ package web import ( "net/http" - "runtime/debug" "sort" "github.com/Jaculabilis/intake/core" @@ -38,17 +37,7 @@ func (env *Env) getRoot(writer http.ResponseWriter, req *http.Request) { channelData = append(channelData, html.ChannelData{Name: name, Active: channels[name]}) } - rev := "" - if info, ok := debug.ReadBuildInfo(); ok { - for _, setting := range info.Settings { - if setting.Key == "vcs.revision" { - rev = setting.Value + rev - } - if setting.Key == "vcs.modified" { - rev = rev + "-dirty" - } - } - } + rev := core.GetRevInfo() data := html.HomeData{ Channels: channelData,