generate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:    "generate",
	Aliases: []string{"g"},
	Usage:   "Generate .gitignore file",
	Flags: []cli.Flag{
		&cli.StringSliceFlag{
			Name:     "lang",
			Aliases:  []string{"l"},
			Required: true,
			Usage:    "Templates to generate file",
		},
		&cli.StringFlag{
			Name:    "path",
			Aliases: []string{"p"},
			Usage:   "Path to .gitignore file",
			Value:   ".",
		},
		&cli.BoolFlag{
			Name:    "force",
			Aliases: []string{"f"},
			Usage:   "Force create a new .gitignore file. This flag will override the existent file",
			Value:   false,
		},
	},
	Action: func(c *cli.Context) error {
		return logging.Log("generating file...", func() error {
			if err := checkFile(c); err != nil {
				return err
			}

			return generate(c)
		})
	},
}

Command for generate

View Source
var ErrFileExists = errors.New(".gitignore file already exists. Use --force flag to override it")

ErrFileExists return if file already exists

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