script

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Echo = script.Echo

Echo returns a pipe containing the supplied string.

View Source
var File = script.File

File returns a *Pipe associated with the specified file. This is useful for starting pipelines. If there is an error opening the file, the pipe's error status will be set.

View Source
var FindFiles = script.FindFiles

FindFiles takes a directory path and returns a pipe listing all the files in the directory and its subdirectories recursively, one per line, like Unix `find -type f`. If the path doesn't exist or can't be read, the pipe's error status will be set.

View Source
var ListFiles = script.ListFiles

ListFiles creates a pipe containing the files and directories matching the supplied path, one per line. The path may be a glob, conforming to filepath.Match syntax.

Functions

func ExecOutput

func ExecOutput(cmds ...string) (string, error)

ExecOutput runs an external command and returns the contents of the pipe.

func ExecStdout

func ExecStdout(cmds ...string) error

ExecStdout runs an external command and writes the contents of the pipe to the program's standard output.

Types

type Pipe

type Pipe = script.Pipe

Pipe represents a pipe object with an associated ReadAutoCloser. https://pkg.go.dev/github.com/bitfield/script#readme-quick-start-unix-equivalents

func Buffer added in v0.1.1

func Buffer(buf io.Reader) *Pipe

Buffer returns a *Pipe associated with the reader buffers. This is useful for starting pipelines. If there is an error opening the file, the pipe's error status will be set.

func Exec

func Exec(cmds ...string) *Pipe

Exec runs an external command and returns a pipe containing the output.

Jump to

Keyboard shortcuts

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