cmd

package
v0.0.0-...-0ec24d7 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitCmd = &cobra.Command{
	Use:   "init",
	Short: "Creates a 'rex.yaml' file on your current path",
	Run: func(cmd *cobra.Command, args []string) {

		cwd, err := os.Getwd()
		if err != nil {
			panic(err)
		}

		configFile := filepath.Join(cwd, "rex.yaml")
		if !isForce {
			if _, err := os.Stat(configFile); !os.IsNotExist(err) {
				color.Red("rex.yaml exists. Use 'rex init --force' to overwrite")
				os.Exit(1)
			}
		} else {
			err := os.Remove(configFile)
			if err != nil {
				panic(err)
			}
		}

		newInitFile(configFile)
	},
}

Functions

func NewRootCmd

func NewRootCmd(f *factory.Factory, appVersion, buildDate string) *cobra.Command

Types

This section is empty.

Directories

Path Synopsis
log

Jump to

Keyboard shortcuts

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