Documentation ¶
Index ¶
- func RenderEnvironmentSettingScript(vars map[string]string, aliases map[string]string) string
- type Command
- type CommandOpts
- type CommandValue
- type DynamicValueOpts
- type ExecutionContext
- type ShellExe
- func (c *ShellExe) GetCmd() *exec.Cmd
- func (c *ShellExe) IncludeEnv(env map[string]string) *ShellExe
- func (c *ShellExe) MustOut() string
- func (c *ShellExe) MustRun()
- func (c *ShellExe) RunE() error
- func (c *ShellExe) RunOut() (string, error)
- func (c *ShellExe) RunOutLog() (string, error)
- func (c *ShellExe) String() string
- func (c *ShellExe) Sudo(enabled bool) *ShellExe
- func (c *ShellExe) WithArgs(args ...string) *ShellExe
- func (c *ShellExe) WithCommand(cmd string) *ShellExe
- func (c *ShellExe) WithContext(ctx context.Context) *ShellExe
- func (c *ShellExe) WithDir(dir string) *ShellExe
- func (c *ShellExe) WithEnvValue(key, value string) *ShellExe
- func (c *ShellExe) WithExe(exe string) *ShellExe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command struct { Command []string `yaml:"command,omitempty,flow" json:"command,omitempty,flow"` Script string `yaml:"script,omitempty" json:"script,omitempty"` OS map[string]*Command `yaml:"os,omitempty" json:"os,omitempty"` // List of tools required for this command to succeed. Tools []string `yaml:"tools,omitempty" json:"tools,omitempty"` // contains filtered or unexported fields }
func (*Command) Execute ¶
func (d *Command) Execute(ctx ExecutionContext, opts ...CommandOpts) (string, error)
Execute executes the ShellExe, and treats the Value field as a script.
func (Command) MarshalYAML ¶
func (*Command) UnmarshalYAML ¶
type CommandOpts ¶
type CommandValue ¶
type CommandValue struct { Comment string `yaml:"comment,omitempty" json:"comment,omitempty"` Value string `yaml:"value" json:"value"` Command `yaml:"-" json:"-"` OS map[string]*CommandValue `yaml:"os,omitempty" json:"os,omitempty"` WorkspaceCommand string `yaml:"workspaceCommand,omitempty"` WorkspaceCommandHint string `yaml:"workspaceCommandHint,omitempty"` Disabled bool `yaml:"disabled"` // contains filtered or unexported fields }
func (*CommandValue) GetValue ¶
func (c *CommandValue) GetValue() string
func (*CommandValue) MarshalYAML ¶
func (c *CommandValue) MarshalYAML() (interface{}, error)
func (*CommandValue) Resolve ¶
func (c *CommandValue) Resolve(ctx ExecutionContext) (string, error)
Resolve sets the Value field by executing Script, Command, or an entry under OS. If resolve has been called before, the value from that resolve is returned.
func (*CommandValue) String ¶
func (c *CommandValue) String() string
func (*CommandValue) UnmarshalYAML ¶
func (c *CommandValue) UnmarshalYAML(node *yaml.Node) error
type DynamicValueOpts ¶
type ExecutionContext ¶
type ExecutionContext interface { cli.ParametersGetter cli.WithPwder cli.EnvironmentVariableGetter templating.TemplateValuer util.WithLogFielder core.Ctxer GetWorkspaceCommand(name string, hint string) *CommandValue }
type ShellExe ¶
type ShellExe struct { // Exe is the executable to invoke. Exe *string // Args is the arguments to be passed to the exe. Args []string Env []string // ShellExe is the exe with its args as a single string, as you would type it on the CLI. Command *string Dir *string // contains filtered or unexported fields }
func GetCommandForScript ¶
func NewShellExe ¶
func NewShellExeFromSlice ¶
func (*ShellExe) MustRun ¶
func (c *ShellExe) MustRun()
MustRun runs the command and kills this process if the command returns an error.
func (*ShellExe) RunE ¶
RunE runs the command and returns the error only. Input and output for current process are attached to the command process.
func (*ShellExe) WithCommand ¶
func (*ShellExe) WithEnvValue ¶
Click to show internal directories.
Click to hide internal directories.