Documentation
¶
Overview ¶
Package cmdutil holds functionality to run turbo via cobra. That includes flag parsing and configuration of components common to all subcommands
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdBase ¶
type CmdBase struct { UI cli.Ui UIFactory ui.Factory Logger hclog.Logger RepoRoot turbopath.AbsoluteSystemPath Config turbostate.Config APIClient *client.APIClient SpacesAPIClient *client.APIClient TurboVersion string }
CmdBase encompasses configured components common to all turbo commands.
func (*CmdBase) LogWarning ¶
LogWarning logs an error and outputs it to the UI.
type Helper ¶
type Helper struct { // TurboVersion is the version of turbo that is currently executing TurboVersion string // contains filtered or unexported fields }
Helper is a struct used to hold configuration values passed via flag, env vars, config files, etc. It is not intended for direct use by turbo commands, it drives the creation of CmdBase, which is then used by the commands themselves.
func NewHelper ¶
func NewHelper(turboVersion string, args *turbostate.ParsedArgsFromRust) *Helper
NewHelper returns a new helper instance to hold configuration values for the root turbo command.
func (*Helper) Cleanup ¶
func (h *Helper) Cleanup(cliConfig *turbostate.ParsedArgsFromRust)
Cleanup runs the register cleanup handlers. It requires the flags to the root command so that it can construct a UI if necessary
func (*Helper) GetCmdBase ¶
func (h *Helper) GetCmdBase(executionState *turbostate.ExecutionState) (*CmdBase, error)
GetCmdBase returns a CmdBase instance configured with values from this helper. It additionally returns a mechanism to set an error, so
func (*Helper) RegisterCleanup ¶
RegisterCleanup saves a function to be run after turbo execution, even if the command that runs returns an error