shell

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrEmptyCommand

type ErrEmptyCommand struct{}

func (*ErrEmptyCommand) Error

func (e *ErrEmptyCommand) Error() string

type Shell

type Shell struct {
	// contains filtered or unexported fields
}

func New

func New(spec ShellSpec) (*Shell, error)

New returns a reference to a newly initialized Shell object from a shellspec or an error if the provided shellspec triggers a validation error.

func (*Shell) Condition

func (s *Shell) Condition(source string) (bool, error)

Condition tests if the provided command (concatenated with the source) is executed with success

func (*Shell) ConditionFromSCM

func (s *Shell) ConditionFromSCM(source string, scm scm.Scm) (bool, error)

ConditionFromSCM tests if the provided command (concatenated with the source) is executed with success from the SCM root directory

func (*Shell) Source

func (s *Shell) Source(workingDir string) (string, error)

Source returns the stdout of the shell command if its exit code is 0 otherwise an error is returned with the content of stderr

func (*Shell) Target

func (s *Shell) Target(source string, dryRun bool) (bool, error)

func (*Shell) TargetFromSCM

func (s *Shell) TargetFromSCM(source string, scm scm.Scm, dryRun bool) (changed bool, commands []string, message string, err error)

type ShellSpec

type ShellSpec struct {
	Command string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL