2022-12-07 15:50:59 +08:00
|
|
|
//----------------------------------------
|
|
|
|
//
|
|
|
|
// Copyright © yanghy. All Rights Reserved.
|
|
|
|
//
|
2023-02-19 23:21:47 +08:00
|
|
|
// Licensed under Apache License Version 2.0, January 2004
|
|
|
|
//
|
|
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
2022-12-07 15:50:59 +08:00
|
|
|
//
|
|
|
|
//----------------------------------------
|
|
|
|
|
2023-01-29 14:24:11 +08:00
|
|
|
package internal
|
2022-11-09 11:50:59 +08:00
|
|
|
|
2022-11-09 18:44:53 +08:00
|
|
|
import (
|
2023-09-03 18:40:44 +08:00
|
|
|
"github.com/energye/energy/v2/cmd/internal/command"
|
2023-09-04 11:36:36 +08:00
|
|
|
"github.com/energye/energy/v2/cmd/internal/install"
|
2022-11-09 18:44:53 +08:00
|
|
|
)
|
2022-11-09 11:50:59 +08:00
|
|
|
|
2023-09-03 18:40:44 +08:00
|
|
|
var CmdInstall = &command.Command{
|
2023-09-11 19:49:35 +08:00
|
|
|
UsageLine: "install -p [path] -v [version] -n [name] -d [download] -os -arch -cef",
|
2023-09-05 22:30:04 +08:00
|
|
|
Short: "Automatic installation and configuration of the energy framework complete development environment",
|
2022-11-11 22:24:17 +08:00
|
|
|
Long: `
|
|
|
|
-p Installation directory Default current directory
|
2023-09-05 17:01:33 +08:00
|
|
|
-v Specifying a version number,Default latest.\
|
|
|
|
-n Name of the framework directory after installation, Default EnergyFramework.\
|
2023-08-21 12:12:26 +08:00
|
|
|
-d Download Source, 0:gitee or 1:github, Default empty
|
2023-09-09 20:16:40 +08:00
|
|
|
-os Specify install OS: [windows, linux, darwin], default current system: os
|
|
|
|
-arch Specify install ARCH: [386, amd64, arm64], Default current system: architecture
|
|
|
|
-cef Install system supports CEF version, provide 4 options, default empty
|
2023-08-18 18:20:52 +08:00
|
|
|
default : Automatically select support for the latest version based on the current system.
|
2023-08-21 12:00:26 +08:00
|
|
|
109 : CEF 109.1.18 is the last one to support Windows 7.
|
|
|
|
106 : CEF 106.1.1 is the last default support for GTK2 in Linux.
|
|
|
|
87 : CEF 87.1.14 is the last one to support Flash.
|
2022-11-18 12:15:47 +08:00
|
|
|
. Execute default command
|
2022-11-11 22:24:17 +08:00
|
|
|
|
2023-09-11 19:49:35 +08:00
|
|
|
Auto installation and configuration of the energy framework complete development environment.
|
2023-09-05 19:09:15 +08:00
|
|
|
Installation package is downloaded over the network during the installation process.
|
2022-11-18 12:58:47 +08:00
|
|
|
`,
|
2022-11-09 18:44:53 +08:00
|
|
|
}
|
|
|
|
|
2022-11-09 12:12:40 +08:00
|
|
|
func init() {
|
|
|
|
CmdInstall.Run = runInstall
|
|
|
|
}
|
|
|
|
|
2022-11-18 12:15:47 +08:00
|
|
|
// https://cef-builds.spotifycdn.com/cef_binary_107.1.11%2Bg26c0b5e%2Bchromium-107.0.5304.110_windows64.tar.bz2
|
2023-02-19 23:21:47 +08:00
|
|
|
// 运行安装
|
2023-09-03 18:40:44 +08:00
|
|
|
func runInstall(c *command.Config) error {
|
2023-09-10 21:57:00 +08:00
|
|
|
return install.Install(c)
|
2022-11-09 11:50:59 +08:00
|
|
|
}
|