mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
update pmg banner & fix empty commit (#127)
* update pmg banner & fix empty commit * rm old banner * precompile regex for version * fix: Color in github URL (#128) --------- Co-authored-by: Abhisek Datta <abhisek.datta@gmail.com>
This commit is contained in:
co-authored by
Abhisek Datta
parent
edfdd543e0
commit
ff4a4a4734
@@ -8,8 +8,21 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
buildInfo, ok := runtimeDebug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
if Version == "" {
|
||||
buildInfo, _ := runtimeDebug.ReadBuildInfo()
|
||||
Version = buildInfo.Main.Version
|
||||
}
|
||||
|
||||
if Commit == "" {
|
||||
for _, setting := range buildInfo.Settings {
|
||||
if setting.Key == "vcs.revision" {
|
||||
Commit = setting.Value
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user