cmd

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2017 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "v0.9.5"

Version is the current version of the buffalo binary

Variables

View Source
var RootCmd = &cobra.Command{
	SilenceErrors: true,
	Use:           "buffalo",
	Short:         "Helps you build your Buffalo applications that much easier!",
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		fmt.Printf("Buffalo version %s\n\n", Version)

		anywhereCommands := []string{"new", "version", "info"}
		isFreeCommand := false
		for _, freeCmd := range anywhereCommands {
			if freeCmd == cmd.Name() {
				isFreeCommand = true
			}
		}

		if isFreeCommand {
			return nil
		}

		if insideBuffaloProject() == false {
			return errors.New("you need to be inside your buffalo project path to run this command")
		}

		return nil
	},
}

RootCmd is the hook for all of the other commands in the buffalo binary.

Functions

func Execute

func Execute()

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

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