From 3be90a02fc4eafb68e5b7e255e5125980295e235 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期四, 19 十二月 2019 15:07:36 +0800 Subject: [PATCH] fix bug --- service/SysService.go | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/service/SysService.go b/service/SysService.go index b4a6bc6..a13458c 100644 --- a/service/SysService.go +++ b/service/SysService.go @@ -171,13 +171,13 @@ return false,errors.New("鑾峰彇鍗囩骇鍘嬬缉鍖卪d5澶辫触") } if strMd5 == identifier { - if util.ZipCheck(zipFilePath + ext) { + if util.ZipCheck(zipFilePath) { if !updatePatch(identifier, ext) { return false,errors.New("鎵ц鍗囩骇杩囩▼寮傚父") } return true,nil } else { - logger.Debug("not a valid zip file,path:",zipFilePath+ext) + logger.Debug("not a valid zip file,path:",zipFilePath) return false,errors.New("鍗囩骇绋嬪簭瑙e帇澶辫触锛岃纭畾涓婁紶鐨勮ˉ涓佹槸zip鏍煎紡") } } else { @@ -207,14 +207,15 @@ return false } } - err := util.UnZip(configPatchPath+"/"+identifier+ext, unZipPath) + zipFilePath := configPatchPath+"/"+identifier+ext + err := util.UnZip(zipFilePath, unZipPath) if err !=nil { - logger.Debug("UnZip err:",err,"zipFile:",configPatchPath+"/"+identifier+ext) + logger.Debug("UnZip err:",err,"zipFile:",zipFilePath) return false } //2.鏇存柊绯荤粺 var cmd *exec.Cmd - updateCmd := fmt.Sprintf("setsid ./updatePatch.sh %s %s %s",unZipPath,configPatchPath+"/"+identifier+ext,configPatchPath+"/"+identifier) + updateCmd := fmt.Sprintf("setsid ./updatePatch.sh %s %s %s",unZipPath,zipFilePath,configPatchPath+"/"+identifier) cmd = exec.Command("/bin/sh","-c", updateCmd) if b, err := cmd.Output(); err != nil { logger.Debug("updatePatch err:",err,"result:",string(b)) -- Gitblit v1.8.0