mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 14:30:10 +08:00
优化 manifest
This commit is contained in:
parent
fe9b5023f6
commit
86296a28df
@ -4,6 +4,8 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/kanban/banner"
|
"github.com/FloatTech/ZeroBot-Plugin/kanban/banner"
|
||||||
@ -55,7 +57,7 @@ const js = `{
|
|||||||
"0409": {
|
"0409": {
|
||||||
"Comments": "OneBot plugins based on ZeroBot",
|
"Comments": "OneBot plugins based on ZeroBot",
|
||||||
"CompanyName": "FloatTech",
|
"CompanyName": "FloatTech",
|
||||||
"FileDescription": "Project: https://github.com/FloatTech/ZeroBot-Plugin",
|
"FileDescription": "https://github.com/FloatTech/ZeroBot-Plugin",
|
||||||
"FileVersion": "%s",
|
"FileVersion": "%s",
|
||||||
"InternalName": "",
|
"InternalName": "",
|
||||||
"LegalCopyright": "%s",
|
"LegalCopyright": "%s",
|
||||||
@ -80,7 +82,21 @@ func main() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
defer f.Close()
|
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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,16 +36,16 @@
|
|||||||
"#1": {
|
"#1": {
|
||||||
"0000": {
|
"0000": {
|
||||||
"fixed": {
|
"fixed": {
|
||||||
"file_version": "v1.7.0-beta1",
|
"file_version": "1.7.0.1717",
|
||||||
"product_version": "v1.7.0-beta1",
|
"product_version": "v1.7.0-beta1",
|
||||||
"timestamp": "2023-03-01T14:08:55+08:00"
|
"timestamp": "2023-03-01T14:34:01+08:00"
|
||||||
},
|
},
|
||||||
"info": {
|
"info": {
|
||||||
"0409": {
|
"0409": {
|
||||||
"Comments": "OneBot plugins based on ZeroBot",
|
"Comments": "OneBot plugins based on ZeroBot",
|
||||||
"CompanyName": "FloatTech",
|
"CompanyName": "FloatTech",
|
||||||
"FileDescription": "Project: https://github.com/FloatTech/ZeroBot-Plugin",
|
"FileDescription": "https://github.com/FloatTech/ZeroBot-Plugin",
|
||||||
"FileVersion": "v1.7.0-beta1",
|
"FileVersion": "1.7.0.1717",
|
||||||
"InternalName": "",
|
"InternalName": "",
|
||||||
"LegalCopyright": "© 2020 - 2023 FloatTech",
|
"LegalCopyright": "© 2020 - 2023 FloatTech",
|
||||||
"LegalTrademarks": "",
|
"LegalTrademarks": "",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user