From 40d33925207c8416369d1eed8701e3ee664d4b02 Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Thu, 3 Aug 2023 16:47:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20cloudreve=20?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=95=B0=E6=8D=AE=E4=B8=A2=E5=A4=B1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#1822)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/app_utils.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go index f45b65469..664180f2e 100644 --- a/backend/app/service/app_utils.go +++ b/backend/app/service/app_utils.go @@ -271,15 +271,10 @@ func upgradeInstall(installId uint, detailId uint, backup bool) error { detailDir = path.Join(constant.ResourceDir, "apps", "local", strings.TrimPrefix(install.App.Key, "local"), detail.Version) } - cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("cp -rf %s/* %s", detailDir, install.GetPath())) - stdout, err := cmd.CombinedOutput() - if err != nil { - if stdout != nil { - upErr = errors.New(string(stdout)) - return - } - upErr = err - return + cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("cp -rn %s/* %s || true", detailDir, install.GetPath())) + stdout, _ := cmd.CombinedOutput() + if stdout != nil { + global.LOG.Errorf("upgrade app [%s] [%s] cp file log : %s ", install.App.Key, install.Name, string(stdout)) } composeMap := make(map[string]interface{})