buffalo: github.com/gobuffalo/buffalo/buffalo/cmd Index | Files | Directories

package cmd

import "github.com/gobuffalo/buffalo/buffalo/cmd"

Index

Package Files

build.go destroy.go dev.go events.go fix.go generate.go info.go new.go plugins.go root.go routes.go setup.go task.go test.go version.go

Constants

const (
    // EvtSetupStarted is emitted when `buffalo setup` starts
    EvtSetupStarted = "buffalo:setup:started"
    // EvtSetupErr is emitted if `buffalo setup` fails
    EvtSetupErr = "buffalo:setup:err"
    // EvtSetupFinished is emitted when `buffalo setup` finishes
    EvtSetupFinished = "buffalo:setup:finished"
)

Variables

var DestroyCmd = &cobra.Command{
    Use:     "destroy",
    Short:   "Destroy generated components",
    Aliases: []string{"d"},
}

DestroyCmd destroys generated code

var RootCmd = &cobra.Command{
    SilenceErrors: true,
    Use:           "buffalo",
    Short:         "Build Buffalo applications with ease",
    PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
        if err := buffalo.LoadPlugins(); err != nil {
            return err
        }
        isFreeCommand := false
        for _, freeCmd := range anywhereCommands {
            if freeCmd == cmd.Name() {
                isFreeCommand = true
            }
        }

        if isFreeCommand {
            return nil
        }

        if !insideBuffaloProject() {
            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.

func Execute Uses

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.

Directories

PathSynopsis
destroy
fix
generate
plugins
plugins/internal/cache
updater

Package cmd imports 54 packages (graph) and is imported by 22 packages. Updated 2019-06-16. Refresh now. Tools for package owners.