提交 b0839d7a 编写于 作者: chai2010's avatar chai2010

增加 版本号 文件

上级 dfa6b443
......@@ -9,9 +9,7 @@ package app
import (
"fmt"
"os"
"runtime/debug"
"strings"
"time"
"wa-lang.org/wa/api"
"wa-lang.org/wa/internal/3rdparty/cli"
......@@ -20,20 +18,14 @@ import (
"wa-lang.org/wa/internal/lsp"
"wa-lang.org/wa/internal/wabt"
"wa-lang.org/wa/internal/wazero"
"wa-lang.org/wa/waroot"
)
func Main() {
cliApp := cli.NewApp()
cliApp.Name = "Wa"
cliApp.Usage = "Wa is a tool for managing Wa source code."
cliApp.Version = func() string {
if info, ok := debug.ReadBuildInfo(); ok {
if info.Main.Version != "" {
return info.Main.Version
}
}
return "devel:" + time.Now().Format("2006-01-02+15:04:05")
}()
cliApp.Version = waroot.GetVersion()
cliApp.Flags = []cli.Flag{
&cli.StringFlag{
......
v0.8.0-dev
\ No newline at end of file
......@@ -10,12 +10,20 @@ import (
"wa-lang.org/wa/internal/config"
)
//go:embed VERSION
var _VERSION string
//go:embed misc/_example_app
var _exampleAppFS embed.FS
//go:embed misc/_example_vendor
var _exampleVendorFS embed.FS
// 版本号(dev后缀表示开发版)
func GetVersion() string {
return _VERSION
}
func GetExampleAppFS() fs.FS {
fs, err := fs.Sub(_exampleAppFS, "_example_app")
if err != nil {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册