From 215c70db23c1b46837981acd1ce069a90a281710 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 7 Sep 2022 12:18:39 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E9=9B=86=E5=B8=82=E5=B7=B2=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E5=8C=85=E5=9C=A8=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E4=B8=8D=E5=BA=94=E8=AF=A5=E6=98=BE=E7=A4=BA=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=8C=89=E9=92=AE=20https://github.com/siyuan-note/siyuan/issu?= =?UTF-8?q?es/5838?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/bazaar/package.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/kernel/bazaar/package.go b/kernel/bazaar/package.go index aac7d3316..43eef9767 100644 --- a/kernel/bazaar/package.go +++ b/kernel/bazaar/package.go @@ -180,6 +180,12 @@ func isOutdatedTheme(theme *Theme, bazaarThemes []*Theme) bool { return false } + repo := strings.TrimPrefix(theme.URL, "https://github.com/") + parts := strings.Split(repo, "/") + if 2 != len(parts) || "" == strings.TrimSpace(parts[1]) { + return false + } + for _, pkg := range bazaarThemes { if theme.URL == pkg.URL && theme.Name == pkg.Name && theme.Author == pkg.Author && theme.Version != pkg.Version { theme.RepoHash = pkg.RepoHash @@ -194,6 +200,12 @@ func isOutdatedIcon(icon *Icon, bazaarIcons []*Icon) bool { return false } + repo := strings.TrimPrefix(icon.URL, "https://github.com/") + parts := strings.Split(repo, "/") + if 2 != len(parts) || "" == strings.TrimSpace(parts[1]) { + return false + } + for _, pkg := range bazaarIcons { if icon.URL == pkg.URL && icon.Name == pkg.Name && icon.Author == pkg.Author && icon.Version != pkg.Version { icon.RepoHash = pkg.RepoHash @@ -208,6 +220,12 @@ func isOutdatedWidget(widget *Widget, bazaarWidgets []*Widget) bool { return false } + repo := strings.TrimPrefix(widget.URL, "https://github.com/") + parts := strings.Split(repo, "/") + if 2 != len(parts) || "" == strings.TrimSpace(parts[1]) { + return false + } + for _, pkg := range bazaarWidgets { if widget.URL == pkg.URL && widget.Name == pkg.Name && widget.Author == pkg.Author && widget.Version != pkg.Version { widget.RepoHash = pkg.RepoHash @@ -222,6 +240,12 @@ func isOutdatedTemplate(template *Template, bazaarTemplates []*Template) bool { return false } + repo := strings.TrimPrefix(template.URL, "https://github.com/") + parts := strings.Split(repo, "/") + if 2 != len(parts) || "" == strings.TrimSpace(parts[1]) { + return false + } + for _, pkg := range bazaarTemplates { if template.URL == pkg.URL && template.Name == pkg.Name && template.Author == pkg.Author && template.Version != pkg.Version { template.RepoHash = pkg.RepoHash