Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var InternalActions = map[string]achieve.ActionProviderFunc{ "github": github.Provider, "script": script.Provider, }
InternalActions ...
View Source
var RootCmd = &cobra.Command{ Use: "achieve task", Short: "A modern tool for development task automation", Long: ``, PreRunE: func(cmd *cobra.Command, args []string) error { if len(args) > 0 && args[0] == "internal-plugin" { err := pluginCmd.RunE(pluginCmd, args[1:]) if err != nil { return err } } return nil }, RunE: func(cmd *cobra.Command, args []string) error { taskName := "default" if len(args) > 0 { taskName = args[0] } if cfgFile == "" { cfgFile = ".Achievefile" } log.SetOutput(ioutil.Discard) rootCfg := DefaultConfig err := rootCfg.LoadPlugins() if err != nil { return err } config, err := achieve.LoadConfig(cfgFile) if err != nil { return err } ctx = NewContext(taskName, config) ctx.Providers = rootCfg.ActionProviderFactories() fmt.Printf("Executing Task %s\n", taskName) ctx.Execute() return nil }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
type Config ¶
var DefaultConfig Config
func (*Config) ActionProviderFactories ¶
func (*Config) LoadPlugins ¶
type Context ¶
type Context struct {
Config *achieve.Config
Providers map[string]achieve.ActionProviderFactory
// contains filtered or unexported fields
}
Context ...
func NewContext ¶
NewContext returns a new Context
Click to show internal directories.
Click to hide internal directories.