From 67068d7d2e888a6726ce7f1311d123135224637d Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期四, 19 十二月 2019 15:55:14 +0800
Subject: [PATCH] fix updatePatch,add &

---
 service/SysService.go |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/service/SysService.go b/service/SysService.go
index b078a6b..c50339f 100644
--- a/service/SysService.go
+++ b/service/SysService.go
@@ -201,15 +201,15 @@
 	unZipPath := configPatchPath+"/"+identifier+"_basic/"
 	if util.Exists(unZipPath) {
 		//姝ょ増鏈凡缁忔洿鏂拌繃
-		rmErr := os.Remove(unZipPath)
+		rmErr := os.RemoveAll(unZipPath)
 		if rmErr !=nil {
 			return false
 		}
-	} else {
-		if !util.CreateDirectory(unZipPath) {
-			return false
-		}
 	}
+	if !util.CreateDirectory(unZipPath) {
+		return false
+	}
+
 	zipFilePath := configPatchPath+"/"+identifier+ext
 	err := util.UnZip(zipFilePath, unZipPath)
 	if err !=nil {
@@ -218,7 +218,7 @@
 	}
 	//2.鏇存柊绯荤粺
 	var cmd *exec.Cmd
-	updateCmd := fmt.Sprintf("setsid ./updatePatch.sh %s %s %s",unZipPath,zipFilePath,configPatchPath+"/"+identifier)
+	updateCmd := fmt.Sprintf("./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