run

package
v0.0.0-...-5b10271 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RunCmd = climax.Command{
	Name:  "run",
	Brief: "Run a recipe",
	Help:  "Run a recipe",
	Flags: []climax.Flag{
		{
			Name:     "recipe",
			Short:    "r",
			Usage:    `--recipe=<name>`,
			Help:     `The name of the recipe to run`,
			Variable: true,
		},
		{
			Name:     "directory",
			Short:    "d",
			Usage:    `--directory=<path-to-directory>`,
			Help:     `Directory to look for the recipe`,
			Variable: true,
		},
	},
	Handle: func(ctx climax.Context) int {
		var recipe, directory string

		if r, ok := ctx.Get("recipe"); ok {
			recipe = r
		} else {
			log.Fatal("Name of the recipe is required")
		}

		if _, ok := ctx.Get("directory"); !ok {
			directory = utils.RecipesDirectory()
		}

		fmt.Println(recipe, directory)

		return 0
	},
}

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