From 9ce3cb75c6de460ce035061b10b6359bc26fdb7c Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 7 Mar 2023 09:49:36 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=8A=A0=E5=85=A5=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/conf.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/model/conf.go b/kernel/model/conf.go index 3aee764c8..4523e09db 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -19,7 +19,6 @@ package model import ( "bytes" "fmt" - "github.com/88250/lute/ast" "os" "path/filepath" "runtime" @@ -31,6 +30,7 @@ import ( "github.com/88250/gulu" "github.com/88250/lute" + "github.com/88250/lute/ast" "github.com/Xuanwo/go-locale" humanize "github.com/dustin/go-humanize" "github.com/getsentry/sentry-go" @@ -40,6 +40,7 @@ import ( "github.com/siyuan-note/siyuan/kernel/sql" "github.com/siyuan-note/siyuan/kernel/treenode" "github.com/siyuan-note/siyuan/kernel/util" + "golang.org/x/mod/semver" "golang.org/x/text/language" ) @@ -213,6 +214,11 @@ func InitConf() { Conf.System = conf.NewSystem() Conf.OpenHelp = true } else { + if 0 < semver.Compare("v"+util.Ver, "v"+Conf.System.KernelVersion) { + logging.LogInfof("upgraded from version [%s] to [%s]", Conf.System.KernelVersion, util.Ver) + } else { + logging.LogInfof("downgraded from version [%s] to [%s]", Conf.System.KernelVersion, util.Ver) + } Conf.OpenHelp = Conf.System.KernelVersion != util.Ver Conf.System.KernelVersion = util.Ver Conf.System.IsInsider = util.IsInsider