proc

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(name string, args ...string) *exec.Cmd

Command returns a exec.Cmd struct to execute the named program with the given arguments. The parent death signal is set to SIGKILL for platforms that support it.

func CommandContext

func CommandContext(ctx context.Context, name string, args ...string) *exec.Cmd

CommandContext is like Command but includes a context.

func Exec

func Exec(name string, args ...string) error

Exec executes the named program with the given arguments. The parent process will be replaced by the new process, for platforms that support it.

func IsOlder

func IsOlder(target string, sources ...string) (bool, error)

IsOlder returns true if the target is older than any of the source files.

If the target does not exist, IsOlder returns true. It returns an error if any of the sources does not exist.

Types

type Cmd

type Cmd struct {

	// Before is called before the command is executed.
	Before func(*Cmd) error

	// Line is the command line to execute.
	Line string

	// Sources are used to substitute the $srcs in the command line.
	Sources []string

	// Sources are used to substitute the $tgts in the command line.
	Targets []string

	// Env is the environment to use for the command.
	Env map[string]string
}

func Task

func Task(s string) *Cmd

Task returns a Cmd struct which implements the project.Task interface.

func (*Cmd) Inputs

func (c *Cmd) Inputs() []string

func (*Cmd) Outputs

func (c *Cmd) Outputs() []string

func (*Cmd) Run

func (c *Cmd) Run() error

func (*Cmd) String

func (c *Cmd) String() string

Jump to

Keyboard shortcuts

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