Documentation ¶
Index ¶
- Variables
- func GoBin() string
- func GoPath() string
- func GuardDefaultPatterns() []string
- func KillTree(pid int) error
- func LookPath(name string) string
- func MustGoTool(path string)
- type ExecContext
- func (ctx *ExecContext) Args(args []string) *ExecContext
- func (ctx *ExecContext) Context(c context.Context) *ExecContext
- func (ctx *ExecContext) Dir(dir string) *ExecContext
- func (ctx *ExecContext) Do() error
- func (ctx *ExecContext) Env(env ...string) *ExecContext
- func (ctx *ExecContext) GetCmd() *exec.Cmd
- func (ctx *ExecContext) MustDo()
- func (ctx *ExecContext) MustString() string
- func (ctx *ExecContext) NewEnv(env ...string) *ExecContext
- func (ctx *ExecContext) Prefix(p string) *ExecContext
- func (ctx *ExecContext) Raw() *ExecContext
- func (ctx *ExecContext) String() (string, error)
- type GuardContext
- func (ctx *GuardContext) ClearScreen() *GuardContext
- func (ctx *GuardContext) Debounce(debounce *time.Duration) *GuardContext
- func (ctx *GuardContext) Dir(d string) *GuardContext
- func (ctx *GuardContext) Do() error
- func (ctx *GuardContext) ExecCtx(c *ExecContext) *GuardContext
- func (ctx *GuardContext) Interval(interval *time.Duration) *GuardContext
- func (ctx *GuardContext) MustDo()
- func (ctx *GuardContext) NoInitRun() *GuardContext
- func (ctx *GuardContext) Patterns(patterns ...string) *GuardContext
- func (ctx *GuardContext) Stop()
- type TaskCmd
- type TaskContext
- type TasksContext
Constants ¶
This section is empty.
Variables ¶
var TasksNew = kingpin.New
TasksNew ...
Functions ¶
func GuardDefaultPatterns ¶
func GuardDefaultPatterns() []string
GuardDefaultPatterns match all, then ignore all gitignore rules and all submodules
func LookPath ¶ added in v0.18.0
LookPath finds the executable from PATH and GOBIN, if nothing found the input value will be returned
func MustGoTool ¶
func MustGoTool(path string)
MustGoTool try to find executable bin under GOPATH, if not exists run go get to download it
Types ¶
type ExecContext ¶
type ExecContext struct {
// contains filtered or unexported fields
}
ExecContext ...
func Exec ¶
func Exec(args ...string) *ExecContext
Exec executes os command and auto pipe stdout and stdin
func (*ExecContext) Args ¶
func (ctx *ExecContext) Args(args []string) *ExecContext
Args sets arguments
func (*ExecContext) Context ¶ added in v0.19.0
func (ctx *ExecContext) Context(c context.Context) *ExecContext
Context sets the context of the Command
func (*ExecContext) Dir ¶
func (ctx *ExecContext) Dir(dir string) *ExecContext
Dir sets the working dir to execute
func (*ExecContext) Env ¶
func (ctx *ExecContext) Env(env ...string) *ExecContext
Env appends the current env with strings, each string should be something like "key=value"
func (*ExecContext) GetCmd ¶
func (ctx *ExecContext) GetCmd() *exec.Cmd
GetCmd gets the exec.Cmd to execute
func (*ExecContext) NewEnv ¶ added in v0.18.0
func (ctx *ExecContext) NewEnv(env ...string) *ExecContext
NewEnv overrides the parrent Env with the env passed in
func (*ExecContext) Prefix ¶
func (ctx *ExecContext) Prefix(p string) *ExecContext
Prefix sets the prefix string of the stdout and stderr
type GuardContext ¶
type GuardContext struct {
// contains filtered or unexported fields
}
GuardContext ...
func Guard ¶
func Guard(args ...string) *GuardContext
Guard run and guard a command, kill and rerun it if watched files are modified. Because it's based on polling, so it's cross-platform and file system. The args supports go template, variables {{path}}, {{file}}, {{op}} are available. The default patterns are GuardDefaultPatterns
func (*GuardContext) ClearScreen ¶
func (ctx *GuardContext) ClearScreen() *GuardContext
ClearScreen clear screen before each run
func (*GuardContext) Debounce ¶
func (ctx *GuardContext) Debounce(debounce *time.Duration) *GuardContext
Debounce suppress the frequency of the event
func (*GuardContext) ExecCtx ¶
func (ctx *GuardContext) ExecCtx(c *ExecContext) *GuardContext
ExecCtx ...
func (*GuardContext) Interval ¶
func (ctx *GuardContext) Interval(interval *time.Duration) *GuardContext
Interval poll interval
func (*GuardContext) NoInitRun ¶
func (ctx *GuardContext) NoInitRun() *GuardContext
NoInitRun don't execute the cmd on startup
func (*GuardContext) Patterns ¶
func (ctx *GuardContext) Patterns(patterns ...string) *GuardContext
Patterns set patterns
type TaskContext ¶
type TaskContext struct {
// contains filtered or unexported fields
}
TaskContext ...
func (*TaskContext) Init ¶
func (ctx *TaskContext) Init(f func(TaskCmd) func()) *TaskContext
Init ...
type TasksContext ¶
type TasksContext struct {
// contains filtered or unexported fields
}
TasksContext ...
func (*TasksContext) Add ¶
func (ctx *TasksContext) Add(tasks ...*TaskContext) *TasksContext
Add ...
func (*TasksContext) App ¶
func (ctx *TasksContext) App(app *kingpin.Application) *TasksContext
App ...