Skip to content

Commit

Permalink
优化命令行工具,升级CEF大于109版本兼容Windows7
Browse files Browse the repository at this point in the history
  • Loading branch information
sxmxta committed Nov 2, 2023
1 parent 8d95fae commit 25ceb18
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
4 changes: 2 additions & 2 deletions cmd/internal/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var CmdInstall = &command.Command{
Short: "Automatic installation and configuration of the energy framework complete development environment",
Long: `
-p Installation directory Default current directory
-v Specifying a version number,Default latest.\
-n Name of the framework directory after installation, Default EnergyFramework.\
-v Specifying a version number,Default latest
-n Name of the framework directory after installation, Default EnergyFramework
-d Download Source, 0:gitee or 1:github, Default empty
-os Specify install OS: [windows, linux, darwin], default current system: os
-arch Specify install ARCH: [386, amd64, arm64], Default current system: architecture
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func checkInstallEnv(c *command.Config) (result []*softEnf) {
// 检查环境变量是否配置
return "All", tools.CheckCEFDir()
}
// 非当月系统架构时检查一下目标安装路径是否已经存在
// 非当前系统架构时检查一下目标安装路径是否已经存在
var lib = func() string {
if c.Install.OS.IsWindows() {
return "libcef.dll"
Expand Down
4 changes: 2 additions & 2 deletions cmd/internal/install/install_cef_framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func installCEFFramework(c *command.Config) (string, func()) {
sourceSelect = tools.ToInt(c.Install.Download)
}
if len(s) > sourceSelect {
return strings.ReplaceAll(url, "{source}", s[sourceSelect])
return strings.ReplaceAll(url, "{source}", strings.TrimSpace(s[sourceSelect]))
}
return url
}
Expand All @@ -201,7 +201,7 @@ func installCEFFramework(c *command.Config) (string, func()) {
if liblclModule != nil {
libEnergyOS, isSupport := liblclOS(c, cef, liblclVersion, tools.ToString(liblclModule["buildSupportOSArch"]))
downloadEnergyURL := tools.ToString(liblclModule["downloadUrl"])
downloadEnergyURL = replaceSource(downloadEnergyURL, tools.ToString(liblclModule["downloadSource"]), tools.ToInt(liblclModule["downloadSourceSelect"]), "liblcl")
downloadEnergyURL = replaceSource(downloadEnergyURL, tools.ToString(liblclModule["downloadSource"]), tools.ToInt(liblclModule["defaultSourceSelect"]), "liblcl")
module := tools.ToString(liblclModule["module"])
downloadEnergyURL = strings.ReplaceAll(downloadEnergyURL, "{version}", liblclVersion)
downloadEnergyURL = strings.ReplaceAll(downloadEnergyURL, "{module}", module)
Expand Down
18 changes: 3 additions & 15 deletions cmd/internal/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,9 @@ func Compare(compare1, compare2 string) bool {
}
compare1 = strings.Split(compare1, "-")[0]
compare2 = strings.Split(compare2, "-")[0]
cv := strings.Split(compare1, ".")
ev := strings.Split(compare2, ".")
c0, _ := strconv.Atoi(cv[0])
c1, _ := strconv.Atoi(cv[1])
c2, _ := strconv.Atoi(cv[2])
e0, _ := strconv.Atoi(ev[0])
e1, _ := strconv.Atoi(ev[1])
e2, _ := strconv.Atoi(ev[2])
if e0 < c0 {
return true
}
if e1 < c1 {
return true
}
if e2 < c2 {
cv, _ := strconv.Atoi(strings.ReplaceAll(compare1, ".", ""))
ev, _ := strconv.Atoi(strings.ReplaceAll(compare2, ".", ""))
if ev < cv {
return true
}
return false
Expand Down

0 comments on commit 25ceb18

Please sign in to comment.