build

package
v1.4.11 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2016 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DryRunFlag = flag.Bool("n", false, "dry run, don't execute commands")
)

Functions

func AddFile

func AddFile(a Archive, file string) error

AddFile appends an existing file to an archive.

func GOPATH

func GOPATH() string

GOPATH returns the value that the GOPATH environment variable should be set to.

func GitCommit added in v1.4.11

func GitCommit() string

func MustRun

func MustRun(cmd *exec.Cmd)

MustRun executes the given command and exits the host process for any error.

func MustRunCommand

func MustRunCommand(cmd string, args ...string)

func Render

func Render(templateFile, outputFile string, outputPerm os.FileMode, x interface{})

Render renders the given template file.

func RenderString

func RenderString(templateContent, outputFile string, outputPerm os.FileMode, x interface{})

func RunGit

func RunGit(args ...string) string

func VERSION added in v1.4.11

func VERSION() string

func WriteArchive

func WriteArchive(basename, ext string, files []string) error

WriteArchive creates an archive containing the given files.

Types

type Archive

type Archive interface {
	// Directory adds a new directory entry to the archive and sets the
	// directory for subsequent calls to Header.
	Directory(name string) error

	// Header adds a new file to the archive. The file is added to the directory
	// set by Directory. The content of the file must be written to the returned
	// writer.
	Header(os.FileInfo) (io.Writer, error)

	// Close flushes the archive and closes the underlying file.
	Close() error
}

func NewArchive

func NewArchive(file *os.File) Archive

func NewTarballArchive

func NewTarballArchive(w io.WriteCloser) Archive

func NewZipArchive

func NewZipArchive(w io.WriteCloser) Archive

type TarballArchive

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

func (*TarballArchive) Close

func (a *TarballArchive) Close() error

func (*TarballArchive) Directory

func (a *TarballArchive) Directory(name string) error

func (*TarballArchive) Header

func (a *TarballArchive) Header(fi os.FileInfo) (io.Writer, error)

type ZipArchive

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

func (*ZipArchive) Close

func (a *ZipArchive) Close() error

func (*ZipArchive) Directory

func (a *ZipArchive) Directory(name string) error

func (*ZipArchive) Header

func (a *ZipArchive) Header(fi os.FileInfo) (io.Writer, error)

Jump to

Keyboard shortcuts

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