github.com/cheikhshift/buffalo@v0.9.5/buffalo/cmd/task.go (about) 1 package cmd 2 3 import ( 4 "errors" 5 "os" 6 7 grifts "github.com/markbates/grift/cmd" 8 "github.com/spf13/cobra" 9 ) 10 11 // task command is a forward to grift tasks 12 var taskCommand = &cobra.Command{ 13 Use: "task", 14 Aliases: []string{"t", "tasks"}, 15 Short: "Runs your grift tasks", 16 RunE: func(c *cobra.Command, args []string) error { 17 _, err := os.Stat("grifts") 18 if err != nil { 19 return errors.New("seems there is no grifts folder on your current directory, please ensure you're inside your buffalo app root") 20 } 21 22 return grifts.Run("buffalo task", args) 23 }, 24 PersistentPreRunE: func(cmd *cobra.Command, args []string) error { 25 return nil 26 }, 27 } 28 29 func init() { 30 decorate("task", taskCommand) 31 RootCmd.AddCommand(taskCommand) 32 }