exec

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec

type Exec struct{}

Exec struct

func NewExec

func NewExec() *Exec

NewExec returns a new Exec

func (Exec) CreateFolderIfDoesNotExist

func (ex Exec) CreateFolderIfDoesNotExist(dir string) error

CreateFolderIfDoesNotExist checks, will check that a folder exist and create the folder if it does not exist

func (Exec) DoGit

func (ex Exec) DoGit(dir string, args ...string) (string, error)

DoGit execute a `git command <args...>`

func (Exec) DoGitClone

func (ex Exec) DoGitClone(dir string, args ...string) (string, error)

DoGitClone execute a `git clone <args...>`

func (Exec) DoGitPush

func (ex Exec) DoGitPush(dir string, args ...string) (string, error)

DoGitPush execute a `git push <args...>`

func (Exec) OpenEditor added in v0.2.33

func (ex Exec) OpenEditor(editor string, args ...string) error

OpenEditor opens the editor

func (Exec) Run

func (ex Exec) Run(dir string, command string, args ...string) ([]byte, error)

Run run command and return output

func (Exec) RunInteractive

func (ex Exec) RunInteractive(command string, args ...string) error

RunInteractive run the command in interactive mode

type IExec

type IExec interface {
	Run(dir string, command string, args ...string) ([]byte, error)
	RunInteractive(command string, args ...string) error
	DoGitClone(dir string, args ...string) (string, error)
	DoGitPush(dir string, args ...string) (string, error)
	DoGit(dir string, args ...string) (string, error)
	CreateFolderIfDoesNotExist(dir string) error
	OpenEditor(editor string, args ...string) error
}

IExec defines exec global interface, useful for testing

Jump to

Keyboard shortcuts

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