From 9f68a07aa8770bb9dc8f03f58fae0a7b995cf8ea Mon Sep 17 00:00:00 2001 From: yanghy Date: Tue, 17 Dec 2024 13:01:16 +0800 Subject: [PATCH] U: energy cli --- cmd/internal/install/install_cef_framework.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cmd/internal/install/install_cef_framework.go b/cmd/internal/install/install_cef_framework.go index 3b9a6bc5..a8d2a830 100644 --- a/cmd/internal/install/install_cef_framework.go +++ b/cmd/internal/install/install_cef_framework.go @@ -117,14 +117,19 @@ func installCEFFramework(config *remotecfg.TConfig, cmdConfig *command.Config) ( downloads[consts.LiblclKey] = &downloadInfo{fileName: urlName(downloadEnergyURL), downloadPath: filepath.Join(cmdConfig.Install.Path, consts.FrameworkCache, urlName(downloadEnergyURL)), frameworkPath: installPathName, url: downloadEnergyURL, module: liblclModuleName} } // 在线下载 CEF 框架二进制包 - for key, dl := range downloads { - term.Section.Println("Download", key, ":", dl.url) - err := tools.DownloadFile(dl.url, dl.downloadPath, env.GlobalDevEnvConfig.Proxy, nil) - if err != nil { - return "", nil, errors.New("Download [" + dl.fileName + "] " + err.Error()) + var sortsKeys = []string{consts.LiblclKey, consts.CefKey} + for _, key := range sortsKeys { + dl, ok := downloads[key] + if ok { + term.Section.Println("Download", key, ":", dl.url) + err := tools.DownloadFile(dl.url, dl.downloadPath, env.GlobalDevEnvConfig.Proxy, nil) + if err != nil { + return "", nil, errors.New("Download [" + dl.fileName + "] " + err.Error()) + } + dl.success = err == nil } - dl.success = err == nil } + // 解压文件, 并根据配置提取文件 term.Logger.Info("Unpack files")