🎨 Add marketplace package config item minAppVersion https://github.com/siyuan-note/siyuan/issues/8330

This commit is contained in:
Daniel 2023-05-24 10:38:30 +08:00
parent 7379ff1e27
commit 8cbe54c2ab
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
6 changed files with 13 additions and 25 deletions

View file

@ -19,6 +19,7 @@ package bazaar
import (
"bytes"
"errors"
"golang.org/x/mod/semver"
"os"
"path/filepath"
"strings"
@ -653,3 +654,10 @@ func getBazaarIndex() map[string]*bazaarPackage {
// defaultMinAppVersion 如果集市包中缺失 minAppVersion 项,则使用该值作为最低支持的版本号,小于该版本号时不显示集市包
// Add marketplace package config item `minAppVersion` https://github.com/siyuan-note/siyuan/issues/8330
const defaultMinAppVersion = "2.9.0"
func disallowDisplayBazaarPackage(minAppVersion string) bool {
if "" == minAppVersion {
return false
}
return 0 > semver.Compare("v"+minAppVersion, "v"+util.Ver)
}