优化 manifest

This commit is contained in:
源文雨 2023-03-01 14:35:13 +08:00
parent fe9b5023f6
commit 86296a28df
2 changed files with 22 additions and 6 deletions

View File

@ -4,6 +4,8 @@ package main
import (
"fmt"
"os"
"os/exec"
"strings"
"time"
"github.com/FloatTech/ZeroBot-Plugin/kanban/banner"
@ -55,7 +57,7 @@ const js = `{
"0409": {
"Comments": "OneBot plugins based on ZeroBot",
"CompanyName": "FloatTech",
"FileDescription": "Project: https://github.com/FloatTech/ZeroBot-Plugin",
"FileDescription": "https://github.com/FloatTech/ZeroBot-Plugin",
"FileVersion": "%s",
"InternalName": "",
"LegalCopyright": "%s",
@ -80,7 +82,21 @@ func main() {
panic(err)
}
defer f.Close()
_, err = fmt.Fprintf(f, js, banner.Version, banner.Version, time.Now().Format(timeformat), banner.Version, banner.Copyright, banner.Version)
i := strings.LastIndex(banner.Version, "-")
if i <= 0 {
i = len(banner.Version)
}
commitcnt := strings.Builder{}
commitcnt.WriteString(banner.Version[1:i])
commitcnt.WriteByte('.')
commitcntcmd := exec.Command("git", "rev-list", "--count", "master")
commitcntcmd.Stdout = &commitcnt
err = commitcntcmd.Run()
if err != nil {
panic(err)
}
fv := commitcnt.String()[:commitcnt.Len()-1]
_, err = fmt.Fprintf(f, js, fv, banner.Version, time.Now().Format(timeformat), fv, banner.Copyright, banner.Version)
if err != nil {
panic(err)
}

View File

@ -36,16 +36,16 @@
"#1": {
"0000": {
"fixed": {
"file_version": "v1.7.0-beta1",
"file_version": "1.7.0.1717",
"product_version": "v1.7.0-beta1",
"timestamp": "2023-03-01T14:08:55+08:00"
"timestamp": "2023-03-01T14:34:01+08:00"
},
"info": {
"0409": {
"Comments": "OneBot plugins based on ZeroBot",
"CompanyName": "FloatTech",
"FileDescription": "Project: https://github.com/FloatTech/ZeroBot-Plugin",
"FileVersion": "v1.7.0-beta1",
"FileDescription": "https://github.com/FloatTech/ZeroBot-Plugin",
"FileVersion": "1.7.0.1717",
"InternalName": "",
"LegalCopyright": "© 2020 - 2023 FloatTech",
"LegalTrademarks": "",