-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathmain.go
More file actions
34 lines (27 loc) · 761 Bytes
/
main.go
File metadata and controls
34 lines (27 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//go:generate go-winres make --in winres/winres.json --product-version=git-tag --file-version=git-tag --arch=amd64,386,arm64
package main
import (
"flag"
"fmt"
"log/slog"
"os"
"github.com/sinspired/subs-check-pro/app"
)
// 命令行参数
var (
flagConfigPath = flag.String("f", "", "配置文件路径")
)
func main() {
// 解析命令行参数
flag.Parse()
// 初始化应用
application := app.New(Version, fmt.Sprintf("%s-%s", Version, CurrentCommit), *flagConfigPath)
// 版本更新成功通知
application.InitUpdateInfo()
slog.Info(fmt.Sprintf("当前版本: %s-%s", Version, CurrentCommit))
if err := application.Initialize(); err != nil {
slog.Error(fmt.Sprintf("初始化失败: %v", err))
os.Exit(1)
}
application.Run()
}