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