x
This commit is contained in:
+1
-1
@@ -288,7 +288,7 @@ func (f *Factory) Destroy() {
|
||||
} else {
|
||||
botid = f.botid
|
||||
}
|
||||
console.Log("%s机器人%s已销毁", strings.ToUpper(f.botplt), botid)
|
||||
console.Log("%s机器人%s已销毁", f.botplt, botid)
|
||||
go func() {
|
||||
if f.uuid != "" {
|
||||
su := &ScriptUtils{
|
||||
|
||||
+8
-2
@@ -120,7 +120,8 @@ func unzip(filename string, perm fs.FileMode, pkg bool) error {
|
||||
}
|
||||
defer zipFile.Close()
|
||||
top := ""
|
||||
for _, file := range zipFile.File {
|
||||
for i := range zipFile.File {
|
||||
file := zipFile.File[i]
|
||||
if top == "" {
|
||||
top = strings.Split(file.Name, "/")[0]
|
||||
}
|
||||
@@ -167,7 +168,12 @@ func unzip(filename string, perm fs.FileMode, pkg bool) error {
|
||||
defer func() { //安装依赖
|
||||
cmd := exec.Command(utils.ExecPath+"/language/node/yarn/bin/yarn", "install")
|
||||
cmd.Dir = utils.ExecPath + "/plugins/" + top
|
||||
console.Log(cmd.Output())
|
||||
data, err := cmd.Output()
|
||||
if err != nil {
|
||||
console.Error("依赖添加失败:", err)
|
||||
} else {
|
||||
console.Log(string(data))
|
||||
}
|
||||
de()
|
||||
}()
|
||||
} else {
|
||||
|
||||
+3
-1
@@ -117,9 +117,11 @@ func initPlugins() {
|
||||
filename := vv.(string)
|
||||
if new == "" {
|
||||
os.RemoveAll(filepath.Dir(filename))
|
||||
} else {
|
||||
} else if new != "install" {
|
||||
fmt.Println("WriteFile", []byte(new))
|
||||
os.WriteFile(filename, []byte(new), 0755)
|
||||
}
|
||||
|
||||
return &storage.Final{
|
||||
Now: "",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user