This commit is contained in:
1-6
2023-07-29 15:26:11 +08:00
parent 2bbf863b65
commit e7f5e8b440
+5 -3
View File
@@ -180,11 +180,13 @@ func unzip(filename string, perm fs.FileMode, pkg bool) error {
} else { } else {
if pkg { if pkg {
defer func() { //安装依赖 defer func() { //安装依赖
cmd := exec.Command(utils.ExecPath+"/language/node/yarn/bin/yarn", "install") yarn := utils.ExecPath + "/language/node/yarn/bin/yarn"
cmd.Dir = utils.ExecPath + "/plugins/" + top dir := utils.ExecPath + "/plugins/" + top
cmd := exec.Command(yarn, "install")
cmd.Dir = dir
data, err := cmd.Output() data, err := cmd.Output()
if err != nil { if err != nil {
console.Error("依赖添加失败:", err) console.Error("依赖添加失败:%v %s\n\n你可以尝试自救:\ncd %s\n%s install", err, string(data), dir, yarn)
} else { } else {
console.Log(string(data)) console.Log(string(data))
} }