This commit is contained in:
1-6
2023-07-25 14:48:49 +08:00
parent 676431a1d5
commit fd2053e14c
5 changed files with 54 additions and 23 deletions
+5 -1
View File
@@ -190,10 +190,14 @@ func AddNodePlugin(path, name string) error {
if err != nil {
return err
}
script := string(data)
if script == "" {
return nil
}
uuid := nameUuid(name)
plugins_id.Store(uuid, path)
// fmt.Println("add,", uuid, name)
f, cbs := pluginParse(string(data), uuid)
f, cbs := pluginParse(script, uuid)
f.Suffix = ".js"
f.Type = "typescript"
f.Handle = func(s common.Sender, f func(vm *goja.Runtime)) interface{} {