shell

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package shell provides helpers for executing shell commands and wrappers for popular commands (e.g., git).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(workingDir, name string, args ...string) ([]byte, error)

Exec executes the given command within workingDir and returns the stdout. If there is an error in starting the command or the command exits with non zero code, returns the stderr wrapped in Go error.

func GitClone added in v0.2.1

func GitClone(targetDir, repoURL string) error

GitClone runs 'git clone' with the repoURL and clones the repo contents into targetDir. targetDir must be an empty directory.

func GitCommit added in v0.2.1

func GitCommit(targetDir, message string) ([]byte, error)

GitCommit runs `git commit -m message` and returns the output.

func GitInit added in v0.2.1

func GitInit(targetDir string, name string) error

GitInit initializes a git repo in the given directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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