mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🎨 Kernel API supports load plugins https://github.com/siyuan-note/siyuan/issues/8044
This commit is contained in:
parent
c62b1a102a
commit
6e864a2718
5 changed files with 36 additions and 3 deletions
|
|
@ -24,6 +24,7 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/dustin/go-humanize"
|
||||
ants "github.com/panjf2000/ants/v2"
|
||||
"github.com/siyuan-note/httpclient"
|
||||
|
|
@ -98,7 +99,13 @@ func Widgets() (widgets []*Widget) {
|
|||
|
||||
func InstalledWidgets() (ret []*Widget) {
|
||||
ret = []*Widget{}
|
||||
widgetDirs, err := os.ReadDir(filepath.Join(util.DataDir, "widgets"))
|
||||
|
||||
widgetsPath := filepath.Join(util.DataDir, "widgets")
|
||||
if !gulu.File.IsDir(widgetsPath) {
|
||||
return
|
||||
}
|
||||
|
||||
widgetDirs, err := os.ReadDir(widgetsPath)
|
||||
if nil != err {
|
||||
logging.LogWarnf("read widgets folder failed: %s", err)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue