Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions kanban/gen/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,41 +35,41 @@ func main() {
panic(err)
}
defer f.Close()

vartag := bytes.NewBuffer(nil)
vartagcmd := exec.Command("git", "tag", "--sort=committerdate")
vartagcmd.Stdout = vartag
err = vartagcmd.Run()
if err != nil {
panic(err)
}

// 修复:正确处理标签输出
output := strings.TrimSpace(vartag.String())
var version string

if output == "" {
// 如果没有git标签,使用默认版本
version = "v0.0.0-dev"
} else {
// 分割标签,过滤空行
lines := strings.Split(output, "\n")
validTags := make([]string, 0)

for _, line := range lines {
if strings.TrimSpace(line) != "" {
validTags = append(validTags, line)
}
}

if len(validTags) == 0 {
version = "v0.0.0-dev"
} else {
// 使用最新的标签(最后一个)
version = validTags[len(validTags)-1]
}
}

now := time.Now()
_, err = fmt.Fprintf(f, banner, version, now.Year(), now.Format(timeformat))
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ import (
// vvvvvvvvvvvvvv //
// vvvv //

_ "github.com/FloatTech/ZeroBot-Plugin/custom" // 自定义插件合集
// _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ahsai" // ahsai tts
_ "github.com/FloatTech/ZeroBot-Plugin/custom" // 自定义插件合集
// _ "github.com/FloatTech/ZeroBot-Plugin/plugin/ahsai" // ahsai tts
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/aifalse" // 服务器监控
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/aiimage" // AI画图
_ "github.com/FloatTech/ZeroBot-Plugin/plugin/aiwife" // 随机老婆
Expand Down