From cfc045ede56bc5a1dd9a307591e892b78c880684 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期六, 30 五月 2020 15:28:04 +0800 Subject: [PATCH] fix unPackPath --- service/SdkInstall.go | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/service/SdkInstall.go b/service/SdkInstall.go index 31088e4..da65aa3 100644 --- a/service/SdkInstall.go +++ b/service/SdkInstall.go @@ -8,6 +8,7 @@ "io/ioutil" "os" "path" + "path/filepath" "webserver/extend/config" "webserver/extend/util" ) @@ -72,6 +73,20 @@ logger.Debug("UnPack err:",err,"unPackFile:",unPackFilePath) return false, err } + targetFileName := "" + err = filepath.Walk(unPackPath, func(path string, f os.FileInfo, err error) error { + if f == nil { + return err + } + if f.IsDir() { + targetFileName = f.Name() + } + return nil + }) + if err != nil { + return false, err + } + unPackPath = unPackPath + targetFileName +"/" //瑙e帇瀹屾垚锛岃幏鍙栧畨瑁呭寘涓殑鏂囦欢锛屽紑濮嬪畨瑁� //1.瑙f瀽瀹夎璇存槑ins.inc incPath := unPackPath+"ins.inc" @@ -80,7 +95,10 @@ var ins InsInc if err = json.Unmarshal(incB, &ins); err == nil { //澶勭悊鎺堟潈淇℃伅 + curMc := "" + if ins.MachineCode != curMc { + } //2.瑙f瀽sdk.def,灏唖o鍜寊conf澶嶅埗鍒�/opt/vasystem/libs/鏂囦欢澶逛笅 defPath := unPackPath + "sdk.def" if util.Exists(defPath) { -- Gitblit v1.8.0