Fix dirty vcs detection
This commit is contained in:
parent
b42d425873
commit
d80ac09122
@ -9,7 +9,7 @@ func GetRevInfo() (rev string) {
|
|||||||
if setting.Key == "vcs.revision" {
|
if setting.Key == "vcs.revision" {
|
||||||
rev = setting.Value + rev
|
rev = setting.Value + rev
|
||||||
}
|
}
|
||||||
if setting.Key == "vcs.modified" {
|
if setting.Key == "vcs.modified" && setting.Value == "true" {
|
||||||
rev = rev + "-dirty"
|
rev = rev + "-dirty"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
13
web/root.go
13
web/root.go
@ -2,7 +2,6 @@ package web
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"runtime/debug"
|
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/Jaculabilis/intake/core"
|
"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]})
|
channelData = append(channelData, html.ChannelData{Name: name, Active: channels[name]})
|
||||||
}
|
}
|
||||||
|
|
||||||
rev := ""
|
rev := core.GetRevInfo()
|
||||||
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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data := html.HomeData{
|
data := html.HomeData{
|
||||||
Channels: channelData,
|
Channels: channelData,
|
||||||
|
Loading…
Reference in New Issue
Block a user