github.com/jasonish/buffalo@v0.8.2-0.20170413145823-bacbdd415f1b/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  	},
    25  }
    26  
    27  func init() {
    28  	RootCmd.AddCommand(taskCommand)
    29  }