Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "exec", Short: "Execute a list of tasks from a file", Run: func(cmd *cobra.Command, args []string) { if len(args) > 0 { help.Show(cmd) } route, err := cmd.Flags().GetString(Flag.Config) if err != nil { handler.ExitByError(err) } data, err := read.File(route) if err != nil { handler.ExitByError(err) } var tasks *exec.Exec err = read.JSON(data, &tasks) if err != nil { handler.ExitByError(err) } for _, task := range tasks.Tasks { out.Print(log.Info, task.Title, task.Description) if err = Do(task); err != nil { out.Print(log.Error, task.Error) handler.ExitByError(err) } out.Print(log.Success, task.Success) } }, }
View Source
var Flag = &struct { Config, ConfigShort string }{ Config: "config", ConfigShort: "c", }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.