Merge master changes into dev
This commit is contained in:
parent
2755e4b502
commit
2cc7fa6ac1
File diff suppressed because one or more lines are too long
|
@ -1,11 +1,25 @@
|
|||
package config
|
||||
|
||||
const (
|
||||
// Version roughly represents the applications current version.
|
||||
Version = "0.4.1"
|
||||
// Title is the name of the application used throughout the configuration process.
|
||||
Title = "HellPot"
|
||||
)
|
||||
import "runtime/debug"
|
||||
|
||||
// Title is the name of the application used throughout the configuration process.
|
||||
const Title = "HellPot"
|
||||
|
||||
var Version = "dev"
|
||||
|
||||
func init() {
|
||||
binInfo := make(map[string]string)
|
||||
info, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
for _, v := range info.Settings {
|
||||
binInfo[v.Key] = v.Value
|
||||
}
|
||||
if gitrev, ok := binInfo["vcs.revision"]; ok && Version == "dev" {
|
||||
Version = gitrev[:7]
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
// BannerOnly when toggled causes HellPot to only print the banner and version then exit.
|
||||
|
|
|
@ -28,8 +28,11 @@ func process(in string) (s string) {
|
|||
defl8, _ := squish.UnpackStr(in)
|
||||
sp := strings.Split(defl8, "|")
|
||||
s = sp[0]
|
||||
if smin == "" {
|
||||
if smin == "" || len(config.Version) == 7 {
|
||||
s = strings.ReplaceAll(s, "$1;40m.", "$1;40m")
|
||||
if len(config.Version) == 7 {
|
||||
s = strings.ReplaceAll(s, "$3;40m.", "$3;40m")
|
||||
}
|
||||
}
|
||||
c := strings.Split(sp[1], ",")
|
||||
cproc := func(in, num string) (inr string) {
|
||||
|
@ -43,7 +46,11 @@ func process(in string) (s string) {
|
|||
for n := 1; n < 5; n++ {
|
||||
s = cproc(s, fmt.Sprintf("%d", n))
|
||||
}
|
||||
|
||||
if len(config.Version) == 7 {
|
||||
maj = "[" + config.Version + "]"
|
||||
min = ""
|
||||
smin = ""
|
||||
}
|
||||
s = strings.ReplaceAll(s, "$maj", maj)
|
||||
s = strings.ReplaceAll(s, "$min", min)
|
||||
s = strings.ReplaceAll(s, "$smin", smin)
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
package extra
|
Loading…
Reference in New Issue