exec

package
v0.7.3-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:     "exec [flags]",
	Short:   "执行命令指令集",
	Example: "\neasyctl exec -c config.yaml",
	Run: func(cmd *cobra.Command, args []string) {

		if configFile == "" {
			klog.Infof("检测到配置文件为空,生成配置文件样例 -> %s", util.ConfigFile)
			os.WriteFile(util.ConfigFile, config, 0666)
		}

		b, err := os.ReadFile(configFile)
		if err != nil {
			panic(err)
		}

		flagset := cmd.Parent().Parent().PersistentFlags()
		debug, err := flagset.GetBool("debug")
		if err != nil {
			panic(err)
		}

		if err := runner.Run(b, debug); err != nil {
			klog.Fatalln(err)
		}
	},
}

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