Skip to content

Commit

Permalink
feat: 增加版本号显示
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Jan 18, 2024
1 parent 3784b2e commit ca68722
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 12 deletions.
12 changes: 0 additions & 12 deletions args/args.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
package args

import (
"embed"
)

// 调试模式

var Debug bool

// 嵌入目录

var Efs *embed.FS

// 机器人参数

var Bot = struct {
Expand Down
31 changes: 31 additions & 0 deletions args/build.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package args

import (
"embed"
)

// 调试模式

var Debug bool

// 嵌入目录

var Efs *embed.FS

// 版本信息

const Version = "0.10.0"
const BuildVersion = "240106"

// 应用描述

const AppName = "TDP Wrest"
const AppSummary = "智能聊天机器人"

// 输出说明
func init() {

println(AppName, AppSummary)
println("Version:", Version, "build", BuildVersion)

}
9 changes: 9 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,17 @@ last_tag=`git tag | sort -V | tail -n 1`
prev_tag=`git tag | sort -V | tail -n 2 | head -n 1`
git log $prev_tag..$last_tag --pretty=format:"%s" | grep -v "^release" | sed 's/^/- /' | sort > RELEASE.md

version=`echo $last_tag | sed 's/^v//'`
sed -i "s/^const Version = \".*\"/const Version = \"$version\"/" args/build.go

build_version=$((`grep -oP 'BuildVersion = "\K\d+' args/build.go` + $RUN_NUMBER))
sed -i "s/^const BuildVersion = \".*\"/const BuildVersion = \"$build_version\"/" args/build.go

echo "build info - tag: $last_tag, version: $version, build: $build_version"

####################################################################


if [ -f webview/public/browser/index.html ]; then
ls -al webview
ls -al webview/public
Expand Down

0 comments on commit ca68722

Please sign in to comment.