exec

package
v0.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:     "exec [flags]",
	Short:   "执行命令指令集",
	Example: "\neasyctl exec 'date' -c config.yaml",
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) != 0 {
			shell := args[0]
			command.DefaultLogger.Infof("执行: %s", shell)
			b, err := os.ReadFile(configFile)
			if err != nil {
				logrus.Infof("未找到配置文件,为您生成配置文件样例, 请修改文件内容后携带 -c 参数重新执行 -> %s", constant.ConfigFile)
				_ = os.WriteFile(constant.ConfigFile, execConfig, 0666)
				os.Exit(-1)
			}
			runner.RemoteRun(runner.RemoteRunItem{
				ManifestContent:     b,
				Logger:              command.DefaultLogger,
				Cmd:                 shell,
				RecordErrServerList: true,
			})
		}
	},
}

RootCmd close命令

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL