Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
5759f31b
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,体验更适合开发者的 AI 搜索 >>
提交
5759f31b
编写于
8月 21, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
U: upgrade command-line tool
上级
d1ee2b83
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
29 deletion
+27
-29
cmd/energy/README.md
cmd/energy/README.md
+4
-23
cmd/energy/build.bat
cmd/energy/build.bat
+14
-2
cmd/internal/command.go
cmd/internal/command.go
+1
-1
cmd/internal/install.go
cmd/internal/install.go
+8
-3
未找到文件。
cmd/energy/README.md
浏览文件 @
5759f31b
# Energy 命令行工具
## 自动配置开发环境
## 使用方式
> 一、使用预编译
>
> 下载地址
>> [energy_cmd_windows32](http://energy.yanghy.cn/download/energy_cmd_windows32.zip)
>>
>> [energy_cmd_windows64](http://energy.yanghy.cn/download/energy_cmd_windows64.zip)
>>
>> [energy_cmd_macosx64](http://energy.yanghy.cn/download/energy_cmd_macosx64.zip)
>>
>> [energy_cmd_linux64](http://energy.yanghy.cn/download/energy_cmd_linux64.zip)
>>
>> 配置到环境变量 或 直接在命令行中执行
>
> 二、自行编译
>
> 需要安装[Golang](https://golang.google.cn/dl/)环境
>>go get -u github.com/energye/energy
>>
go get -u github.com/energye/energy
>>
>> 进入 cmd/energy 目录
>>
...
...
@@ -39,11 +24,7 @@
| version | 可选参数, 版本号v1.1.0, 默认最新版本latest |
>示例
>> 1.
energy install
>> 1.
`energy install .`
>>
>> 2. energy install --path=/app/energyFramework --version=v1.1.0
>>
----
### Public License
[
![license
](
https://img.shields.io/github/license/energye/energy.svg?logo=git&logoColor=green
)
](http://www.apache.org/licenses/LICENSE-2.0)
>> 2. `energy install --path=/app/energyFramework -v x.x.x .`
>>
\ No newline at end of file
cmd/energy/build.bat
浏览文件 @
5759f31b
...
...
@@ -2,18 +2,30 @@ SET CGO_ENABLED=0
set
GOARCH
=
386
set
GOOS
=
windows
go
build
-ldflags
"-s -w"
-o
energy
-
32
.exe
energy
.go
go
build
-ldflags
"-s -w"
-o
energy
-
win
-
32
.exe
energy
.go
set
GOARCH
=
amd64
set
GOOS
=
windows
go
build
-ldflags
"-s -w"
-o
energy
-
64
.exe
energy
.go
go
build
-ldflags
"-s -w"
-o
energy
-win
-
64
.exe
energy
.go
set
GOARCH
=
arm64
set
GOOS
=
windows
go
build
-ldflags
"-s -w"
-o
energy
-winarm
-
64
.exe
energy
.go
set
GOARCH
=
amd64
set
GOOS
=
darwin
go
build
-ldflags
"-s -w"
-o
energy
-darwin
-
64
energy
.go
set
GOARCH
=
arm64
set
GOOS
=
darwin
go
build
-ldflags
"-s -w"
-o
energy
-darwinarm
-
64
energy
.go
set
GOARCH
=
amd64
set
GOOS
=
linux
go
build
-ldflags
"-s -w"
-o
energy
-linux
-
64
energy
.go
set
GOARCH
=
arm64
set
GOOS
=
linux
go
build
-ldflags
"-s -w"
-o
energy
-linuxarm
-
64
energy
.go
pause
\ No newline at end of file
cmd/internal/command.go
浏览文件 @
5759f31b
...
...
@@ -31,7 +31,7 @@ type Install struct {
Path
string
`short:"p" long:"path" description:"Installation directory Default current directory"`
Version
string
`short:"v" long:"version" description:"Specifying a version number"`
Name
string
`short:"n" long:"name" description:"Name of the frame after installation" default:"EnergyFramework"`
Download
string
`short:"d" long:"download" description:"Download Source,
gitee or github, Default gitee" default:"gitee
"`
Download
string
`short:"d" long:"download" description:"Download Source,
0:gitee or 1:github, Default empty" default:"
"`
CEF
string
`short:"c" long:"cef" description:"Install system supports CEF version, provide 4 options, default empty. default, windows7, gtk2, flash" default:""`
}
...
...
cmd/internal/install.go
浏览文件 @
5759f31b
...
...
@@ -203,8 +203,13 @@ func runInstall(c *CommandConfig) error {
println
(
"error: cef module"
,
cefModuleName
,
"is not configured in the current version"
)
os
.
Exit
(
1
)
}
var
replaceSource
=
func
(
url
,
source
string
,
sourceSelect
int
)
string
{
// 下载源选择
var
replaceSource
=
func
(
url
,
source
string
,
sourceSelect
int
,
module
string
)
string
{
s
:=
strings
.
Split
(
source
,
","
)
// liblcl 如果自己选择下载源
if
module
==
"liblcl"
&&
c
.
Install
.
Download
!=
""
{
sourceSelect
=
ToInt
(
c
.
Install
.
Download
)
}
if
len
(
s
)
>
sourceSelect
{
return
strings
.
ReplaceAll
(
url
,
"{source}"
,
s
[
sourceSelect
])
}
...
...
@@ -217,7 +222,7 @@ func runInstall(c *CommandConfig) error {
// 当前模块版本支持系统,如果支持返回下载地址
libCEFOS
,
isSupport
:=
cefOS
(
cefModule
)
downloadCefURL
:=
ToString
(
cefModule
[
"downloadUrl"
])
downloadCefURL
=
replaceSource
(
downloadCefURL
,
ToString
(
cefModule
[
"downloadSource"
]),
ToInt
(
cefModule
[
"downloadSourceSelect"
]))
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
}
...
...
@@ -229,7 +234,7 @@ func runInstall(c *CommandConfig) error {
if
liblclModule
!=
nil
{
libEnergyOS
,
isSupport
:=
liblclOS
(
cef
,
liblclVersion
,
liblclModule
)
downloadEnergyURL
:=
ToString
(
liblclModule
[
"downloadUrl"
])
downloadEnergyURL
=
replaceSource
(
downloadEnergyURL
,
ToString
(
liblclModule
[
"downloadSource"
]),
ToInt
(
liblclModule
[
"downloadSourceSelect"
]))
downloadEnergyURL
=
replaceSource
(
downloadEnergyURL
,
ToString
(
liblclModule
[
"downloadSource"
]),
ToInt
(
liblclModule
[
"downloadSourceSelect"
])
,
"liblcl"
)
module
:=
ToString
(
liblclModule
[
"module"
])
downloadEnergyURL
=
strings
.
ReplaceAll
(
downloadEnergyURL
,
"{version}"
,
liblclVersion
)
downloadEnergyURL
=
strings
.
ReplaceAll
(
downloadEnergyURL
,
"{module}"
,
module
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录