commands

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Root = &cobra.Command{
	Use:           "e2e command [flags]",
	Short:         "The next generation End-to-End Testing framework",
	Version:       version,
	SilenceErrors: true,
	SilenceUsage:  true,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		config.ReadGlobalConfigFile()

		level, err := logrus.ParseLevel(verbosity)
		if err != nil {
			return err
		}
		logger.Log.SetLevel(level)

		util.WorkDir, err = ExpandPathAndCreate(util.WorkDir)
		if err != nil {
			logger.Log.Warnf("failed to create working directory %v", util.WorkDir)
			return err
		}

		util.LogDir, err = ExpandPathAndCreate(util.LogDir)
		if err != nil {
			logger.Log.Warnf("failed to create logging directory %v", util.LogDir)
			return err
		}

		return nil
	},
}

Root represents the base command when called without any subcommands

Functions

func Execute

func Execute() error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func ExpandPathAndCreate added in v1.1.0

func ExpandPathAndCreate(path string) (string, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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