Skip to content

Commit dc2b316

Browse files
committed
update
1 parent 2b931e6 commit dc2b316

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

internal/luapi/plugin/plugin.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"path/filepath"
66
"strings"
77

8+
"github.com/gvcgo/goutils/pkgs/gtea/gprint"
89
"github.com/gvcgo/goutils/pkgs/gutils"
910
"github.com/gvcgo/version-manager/internal/cnf"
1011
"github.com/gvcgo/version-manager/internal/luapi/lua_global"
@@ -36,7 +37,9 @@ func NewPlugins() *Plugins {
3637
}
3738

3839
func (p *Plugins) Update() {
39-
UpdatePlugins()
40+
if err := UpdatePlugins(); err != nil {
41+
gprint.PrintError("update plugins failed: %s", err)
42+
}
4043
}
4144

4245
func (p *Plugins) LoadAll() {
@@ -56,7 +59,9 @@ func (p *Plugins) LoadAll() {
5659
}
5760
ll := lua_global.NewLua()
5861
L := ll.L
59-
L.DoFile(filepath.Join(pDir, f.Name()))
62+
if err := L.DoFile(filepath.Join(pDir, f.Name())); err != nil {
63+
continue
64+
}
6065
pl.PluginName = GetConfItemFromLua(L, PluginName)
6166
if pl.PluginName == "" {
6267
continue

0 commit comments

Comments
 (0)