Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
44768f79
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
44768f79
编写于
8月 21, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
U: upgrade command-line tool
上级
5759f31b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
8 deletion
+10
-8
cmd/energy/build.bat
cmd/energy/build.bat
+3
-3
cmd/internal/install.go
cmd/internal/install.go
+7
-5
未找到文件。
cmd/energy/build.bat
浏览文件 @
44768f79
...
...
@@ -2,15 +2,15 @@ SET CGO_ENABLED=0
set
GOARCH
=
386
set
GOOS
=
windows
go
build
-ldflags
"-s -w"
-o
energy
-win
-
32
.exe
energy
.go
go
build
-ldflags
"-s -w"
-o
energy
-win
dows
-
32
.exe
energy
.go
set
GOARCH
=
amd64
set
GOOS
=
windows
go
build
-ldflags
"-s -w"
-o
energy
-win
-
64
.exe
energy
.go
go
build
-ldflags
"-s -w"
-o
energy
-win
dows
-
64
.exe
energy
.go
set
GOARCH
=
arm64
set
GOOS
=
windows
go
build
-ldflags
"-s -w"
-o
energy
-winarm
-
64
.exe
energy
.go
go
build
-ldflags
"-s -w"
-o
energy
-win
dows
arm
-
64
.exe
energy
.go
set
GOARCH
=
amd64
set
GOOS
=
darwin
...
...
cmd/internal/install.go
浏览文件 @
44768f79
...
...
@@ -59,6 +59,7 @@ type downloadInfo struct {
url
string
success
bool
isSupport
bool
module
string
}
func
init
()
{
...
...
@@ -225,7 +226,7 @@ func runInstall(c *CommandConfig) error {
downloadCefURL
=
replaceSource
(
downloadCefURL
,
ToString
(
cefModule
[
"downloadSource"
]),
ToInt
(
cefModule
[
"downloadSourceSelect"
]),
"cef"
)
downloadCefURL
=
strings
.
ReplaceAll
(
downloadCefURL
,
"{version}"
,
cefVersion
)
downloadCefURL
=
strings
.
ReplaceAll
(
downloadCefURL
,
"{OSARCH}"
,
libCEFOS
)
downloads
[
cefKey
]
=
&
downloadInfo
{
isSupport
:
isSupport
,
fileName
:
urlName
(
downloadCefURL
),
downloadPath
:
filepath
.
Join
(
c
.
Install
.
Path
,
frameworkCache
,
urlName
(
downloadCefURL
)),
frameworkPath
:
installPathName
,
url
:
downloadCefURL
}
downloads
[
cefKey
]
=
&
downloadInfo
{
isSupport
:
isSupport
,
fileName
:
urlName
(
downloadCefURL
),
downloadPath
:
filepath
.
Join
(
c
.
Install
.
Path
,
frameworkCache
,
urlName
(
downloadCefURL
)),
frameworkPath
:
installPathName
,
url
:
downloadCefURL
,
module
:
cefModuleName
}
// liblcl
// 如果选定的cef 106,在linux会指定liblcl gtk2 版本, 其它系统和版本以默认的形式区分
...
...
@@ -239,14 +240,14 @@ func runInstall(c *CommandConfig) error {
downloadEnergyURL
=
strings
.
ReplaceAll
(
downloadEnergyURL
,
"{version}"
,
liblclVersion
)
downloadEnergyURL
=
strings
.
ReplaceAll
(
downloadEnergyURL
,
"{module}"
,
module
)
downloadEnergyURL
=
strings
.
ReplaceAll
(
downloadEnergyURL
,
"{OSARCH}"
,
libEnergyOS
)
downloads
[
liblclKey
]
=
&
downloadInfo
{
isSupport
:
isSupport
,
fileName
:
urlName
(
downloadEnergyURL
),
downloadPath
:
filepath
.
Join
(
c
.
Install
.
Path
,
frameworkCache
,
urlName
(
downloadEnergyURL
)),
frameworkPath
:
installPathName
,
url
:
downloadEnergyURL
}
downloads
[
liblclKey
]
=
&
downloadInfo
{
isSupport
:
isSupport
,
fileName
:
urlName
(
downloadEnergyURL
),
downloadPath
:
filepath
.
Join
(
c
.
Install
.
Path
,
frameworkCache
,
urlName
(
downloadEnergyURL
)),
frameworkPath
:
installPathName
,
url
:
downloadEnergyURL
,
module
:
liblclModuleName
}
}
// 在线下载框架二进制包
for
key
,
dl
:=
range
downloads
{
fmt
.
Printf
(
"Download %s: %s
\n
"
,
key
,
dl
.
url
)
if
!
dl
.
isSupport
{
println
(
"
module is not built or configured 【"
,
dl
.
fileName
,
"]
"
)
println
(
"
Warn module is not built or configured 【"
,
dl
.
module
,
"】
"
)
continue
}
bar
:=
progressbar
.
NewBar
(
100
)
...
...
@@ -257,7 +258,8 @@ func runInstall(c *CommandConfig) error {
})
bar
.
PrintEnd
(
"Download ["
+
dl
.
fileName
+
"] success"
)
if
err
!=
nil
{
println
(
"Download ["
,
dl
.
fileName
,
"] error"
,
err
)
println
(
"Download ["
,
dl
.
fileName
,
"] error:"
,
err
.
Error
())
os
.
Exit
(
1
)
}
dl
.
success
=
err
==
nil
}
...
...
@@ -266,7 +268,7 @@ func runInstall(c *CommandConfig) error {
var
removeFileList
=
make
([]
string
,
0
,
0
)
for
key
,
di
:=
range
downloads
{
if
!
di
.
isSupport
{
println
(
"
energy command line does not support the system architecture.
"
)
println
(
"
Warn module is not built or configured 【"
,
di
.
module
,
"】
"
)
continue
}
if
di
.
success
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录