This commit is contained in:
1-6
2023-07-26 14:25:42 +08:00
parent b120ff803a
commit 2d2c1dd85e
3 changed files with 12 additions and 4 deletions
+8 -2
View File
@@ -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 {