mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 11:58:49 +01:00
🎨 Add marketplace package config item minAppVersion https://github.com/siyuan-note/siyuan/issues/8330
This commit is contained in:
parent
d26bb04110
commit
7379ff1e27
6 changed files with 57 additions and 13 deletions
|
|
@ -30,6 +30,7 @@ import (
|
|||
"github.com/siyuan-note/httpclient"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
"golang.org/x/mod/semver"
|
||||
)
|
||||
|
||||
type Template struct {
|
||||
|
|
@ -63,8 +64,15 @@ func Templates() (templates []*Template) {
|
|||
logging.LogErrorf("get bazaar package [%s] failed: %d", innerU, innerResp.StatusCode)
|
||||
return
|
||||
}
|
||||
template.URL = strings.TrimSuffix(template.URL, "/")
|
||||
|
||||
if "" == template.MinAppVersion {
|
||||
template.MinAppVersion = defaultMinAppVersion
|
||||
}
|
||||
if 0 < semver.Compare("v"+template.MinAppVersion, "v"+util.Ver) {
|
||||
return
|
||||
}
|
||||
|
||||
template.URL = strings.TrimSuffix(template.URL, "/")
|
||||
repoURLHash := strings.Split(repoURL, "@")
|
||||
template.RepoURL = "https://github.com/" + repoURLHash[0]
|
||||
template.RepoHash = repoURLHash[1]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue