energy/cmd/internal/install.go

50 lines
1.8 KiB
Go
Raw Normal View History

//----------------------------------------
//
// Copyright © yanghy. All Rights Reserved.
//
// Licensed under Apache License Version 2.0, January 2004
//
// https://www.apache.org/licenses/LICENSE-2.0
//
//----------------------------------------
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-05 19:09:15 +08:00
UsageLine: "install -p [path] -v [version] -n [name] -d [download] -a [all] -c [cef]",
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
-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-05 19:09:15 +08:00
-a Install all, skip installation prompts (Y/n), default empty:n
2023-08-18 18:20:52 +08:00
-c Install system supports CEF version, provide 4 options, default empty
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
Automatic 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.
According to the prompt (Y), install GolangCEF(Chromium Embedded Framework)NSIS, If installed, skip.
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-09-03 18:40:44 +08:00
func runInstall(c *command.Config) error {
2023-09-04 11:36:36 +08:00
install.Install(c)
2022-11-09 12:12:40 +08:00
return nil
2022-11-09 11:50:59 +08:00
}