commands

package
v0.0.0-...-b313670 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDir

func CheckDir(dir string) error

func CleanDirs

func CleanDirs() error

func Extract

func Extract(filePath, extractPath, fileName string) error

func GitGet

func GitGet(cmd Command, repo, destination string) error

Types

type CacheDirs

type CacheDirs struct {
	Root      string
	Charts    string
	Overrides string
}

type Cmd

type Cmd struct {
	Ctx context.Context
}

func (Cmd) Exec

func (c Cmd) Exec(name string, commands ...string) ([]string, error)

Exec generates a command from a string, runs it, then returns that commands stdout.

func (Cmd) ExecInDir

func (c Cmd) ExecInDir(name string, dir string, commands ...string) ([]string, error)

func (Cmd) ExecInDirUnparsed

func (c Cmd) ExecInDirUnparsed(name, dir string, commands ...string) (string, error)

ExecInDirUnparsed generates a command from a string, runs it within the specified directory

func (Cmd) ExecUnparsed

func (c Cmd) ExecUnparsed(name string, commands ...string) (string, error)

type CmdMock

type CmdMock struct {
	ReturnValue         []string
	ReturnValueUnparsed string
	ReturnError         bool
	ReturnErrorMsg      string
	CmdExecuted         string
}

func (CmdMock) Exec

func (c CmdMock) Exec(n string, cmds ...string) ([]string, error)

func (CmdMock) ExecInDir

func (c CmdMock) ExecInDir(n string, d string, cmds ...string) ([]string, error)

func (CmdMock) ExecInDirUnparsed

func (c CmdMock) ExecInDirUnparsed(n string, d string, cmds ...string) (string, error)

func (CmdMock) ExecUnparsed

func (c CmdMock) ExecUnparsed(n string, cmds ...string) (string, error)

type Command

type Command interface {
	Exec(string, ...string) ([]string, error)
	ExecInDir(string, string, ...string) ([]string, error)
	ExecUnparsed(string, ...string) (string, error)
	ExecInDirUnparsed(string, string, ...string) (string, error)
}

type Dirs

type Dirs struct {
	Tmp      TmpDirs
	Cache    CacheDirs
	Snapshot string
}

func CreateDirs

func CreateDirs() (Dirs, error)

type TmpDirs

type TmpDirs struct {
	Root      string
	Extracted string
	Overrides string
	Hold      string
}

Jump to

Keyboard shortcuts

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