generate

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CMD = &cobra.Command{
	Use:   "generate",
	Short: "extracts completion file from kubectl.",
	Run: func(cmd *cobra.Command, args []string) {
		wd, err := os.Getwd()
		if err != nil {
			fmt.Println(errors.WithMessage(errors.WithStack(err), "failed to get wd"))
			os.Exit(1)
		}

		settings := settings{
			completionFile,
			filepath.Join(wd, outFilename),
		}
		exe.Execute(`cp {{.From}} {{.To}}`, settings)

		handleError(os.Chmod(settings.To, 0755))

		removeUnwantedDeclarations(settings)

		exe.Execute(`goimports -w {{.To}}`, settings)
	},
}

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