stencil

package module
v0.0.0-...-22be34c Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2019 License: Apache-2.0 Imports: 30 Imported by: 1

README

stencil

-- import "github.com/gofunct/stencil"

Usage

const (
	// CaptureStdout is a bitmask to capture STDOUT
	CaptureStdout = 1
	// CaptureStderr is a bitmask to capture STDERR
	CaptureStderr = 2
	// CaptureBoth captures STDOUT and STDERR
	CaptureBoth = CaptureStdout + CaptureStderr
)
var Env string

Env is the default environment to use for all commands. That is, the effective environment for all commands is the merged set of (parent environment, Env, func specified environment). Whitespace or newline separate key value pairs. $VAR interpolation is allowed.

Env = "GOOS=linux GOARCH=amd64" Env = `

GOOS=linux
GOPATH=./vendor:$GOPATH

`

var InheritParentEnv bool

InheritParentEnv whether to inherit parent's environment

var PathListSeparator = "::"

PathListSeparator is a cross-platform path list separator. On Windows, PathListSeparator is replacd by ";". On others, PathListSeparator is replaced by ":"

var Processes = make(map[string]*os.Process)

Processes are the processes spawned by Start()

var Verbose = false

Verbose indicates whether to log verbosely

var Version = "v0.0.1"

Version is the current version

var (

	// WaitMs is the default time (1500 ms) to debounce task events in watch mode.
	Wait time.Duration
)
func Bash
func Bash(script string, options ...map[string]interface{}) (string, error)

Bash executes a bash script (string).

func BashOutput
func BashOutput(script string, options ...map[string]interface{}) (string, error)

BashOutput executes a bash script and returns the output

func EffectiveEnv
func EffectiveEnv(funcEnv []string) []string

EffectiveEnv is the effective environment for an exec function.

func GetWatchDelay
func GetWatchDelay() time.Duration

GetWatchDelay gets the watch delay

func Getenv
func Getenv(key string) string

Getenv environment variable from a string array.

func GoThrottle
func GoThrottle(throttle int, fns ...func() error) error

GoThrottle starts to run the given list of fns concurrently, at most n fns at a time.

func Halt
func Halt(v interface{})

Halt is a soft panic and stops a task.

func Inside
func Inside(dir string, lambda func()) error

Inside temporarily changes the working directory and restores it when lambda finishes.

func ParseStringEnv
func ParseStringEnv(s string) []string

ParseStringEnv parse the package Env string and converts it into an environment slice.

func Prompt
func Prompt(prompt string) string

Prompt prompts user for input with default value.

func PromptPassword
func PromptPassword(prompt string) string

PromptPassword prompts user for password input.

func Run
func Run(commandstr string, options ...map[string]interface{}) (string, error)

Run runs a command.

func RunOutput
func RunOutput(commandstr string, options ...map[string]interface{}) (string, error)

RunOutput runs a command and returns output.

func SetEnviron
func SetEnviron(envstr string, inheritParent bool)

SetEnviron sets the environment for child processes. Note that SetEnviron(Env, InheritParentEnv) is called once automatically.

func SetWatchDelay
func SetWatchDelay(delay time.Duration)

SetWatchDelay sets the time duration between watches.

func Start
func Start(commandstr string, options ...map[string]interface{}) error

Start starts an async command. If executable has suffix ".go" then it will be "go install"ed then executed. Use this for watching a server task.

If Start is called with the same command it kills the previous process.

The working directory is optional.

func Stencil
func Stencil(tasksFunc func(*Project))

Stencil runs a project of tasks.

func Usage
func Usage(tasks string)

Usage prints a usage screen with task descriptions.

type Asset
type Asset struct {
	bytes.Buffer
	Info *glob.FileAsset
	// WritePath is the write destination of the asset.
	WritePath string
	Pipeline  *Pipeline
}

Asset is any file which can be loaded and processed by a filter.

func (*Asset) ChangeExt
func (asset *Asset) ChangeExt(newExt string)

ChangeExt changes the extension of asset.WritePath. ChangExt is used by filters which transpile source. For example, a filter for Markdown would use ChangeExt(".html") to write the asset as an HTML file.

func (*Asset) Dump
func (asset *Asset) Dump() string

Dump returns a console friendly representation of asset. Note, String() returns the string value of Buffer.

func (*Asset) Ext
func (asset *Asset) Ext() string

Ext returns the extension of asset.WritePath.

func (*Asset) IsText
func (asset *Asset) IsText() bool

IsText return true if it thinks this asset is text based, meaning it can be manipulated with string functions.

func (*Asset) MimeType
func (asset *Asset) MimeType() string

MimeType returns an educated guess of the content type of asset.

func (*Asset) Rewrite
func (asset *Asset) Rewrite(bytes []byte)

Rewrite sets the buffer to bytes.

func (*Asset) RewriteString
func (asset *Asset) RewriteString(s string)

RewriteString sets the buffer to a string value.

type Context
type Context struct {
	// Task is the currently running task.
	Job *Job

	Pipeline *Pipeline

	// FileEvent is an event from the watcher with change details.
	FileEvent *watcher.FileEvent

	// Task command line arguments
	Args minimist.ArgMap

	Error error
}

Context is the data passed to a task.

func (*Context) AnyFile
func (context *Context) AnyFile() []string

AnyFile returns either a non-DELETe FileEvent file or the WatchGlob patterns which can be used by goa.Load()

func (*Context) Bash
func (context *Context) Bash(cmd string, options ...map[string]interface{})

Bash runs a bash shell.

func (*Context) BashOutput
func (context *Context) BashOutput(script string, options ...map[string]interface{}) string

BashOutput executes a bash script and returns the output

func (*Context) Check
func (context *Context) Check(err error, msg string)

Check halts the task if err is not nil.

Do this

Check(err, "Some error occured")

Instead of

if err != nil {
	Halt(err)
}
func (*Context) Pipe
func (context *Context) Pipe(filters ...interface{})

Bash runs a bash shell.

func (*Context) Run
func (context *Context) Run(cmd string, options ...map[string]interface{})

Run runs a command

func (*Context) RunOutput
func (context *Context) RunOutput(commandstr string, options ...map[string]interface{}) string

RunOutput runs a command and returns output.

func (*Context) Start
func (context *Context) Start(cmd string, options ...map[string]interface{})

Start run aysnchronously.

type Dependency
type Dependency interface {
	// contains filtered or unexported methods
}

Dependency marks an interface as a dependency.

type Handler
type Handler interface {
	Handle(*Context)
}

Handler is the interface which all task handlers eventually implement.

type HandlerFunc
type HandlerFunc func(*Context)

HandlerFunc is a Handler adapter.

func (HandlerFunc) Handle
func (f HandlerFunc) Handle(ctx *Context)

Handle implements Handler.

type Job
type Job struct {
	Name string

	Handler Handler

	// computed based on dependencies
	EffectiveWatchRegexps []*glob.RegexpInfo
	EffectiveWatchGlobs   []string

	// Complete indicates whether this task has already ran. This flag is
	// ignored in watch mode.
	Complete bool

	RunOnce bool

	SrcFiles   []*glob.FileAsset
	SrcGlobs   []string
	SrcRegexps []*glob.RegexpInfo

	DestFiles   []*glob.FileAsset
	DestGlobs   []string
	DestRegexps []*glob.RegexpInfo

	// used when a file event is received between debounce intervals, the file event
	// will queue itself and set this flag and force debounce to run it
	// when time has elapsed
	sync.Mutex
}

A Task is an operation performed on a user's project directory.

func NewJob
func NewJob(name string, argm minimist.ArgMap) *Job

NewTask creates a new Task.

func (*Job) DependencyNames
func (j *Job) DependencyNames() []string

DependencyNames gets the flattened dependency names.

func (*Job) Deps
func (j *Job) Deps(names ...interface{})

Deps are task dependencies and must specify how to run jobs in series or in parallel.

func (*Job) Desc
func (j *Job) Desc(desc string) *Job

Desc is alias for Description.

func (*Job) Description
func (j *Job) Description(desc string) *Job

Description sets the description for the task.

func (*Job) Dest
func (j *Job) Dest(globs ...string) *Job

Dest adds target globs which are used to calculated outdated files. The jobs is not run unless ANY file Src are newer than ANY in DestN.

func (*Job) Run
func (j *Job) Run() error

Run runs all the dependencies of this job and when they have completed, runs this job.

func (*Job) RunWithEvent
func (j *Job) RunWithEvent(logName string, e *watcher.FileEvent) (err error)

RunWithEvent runs this task when triggered from a watch. e FileEvent contains information about the file/directory which changed in watch mode.

func (*Job) Src
func (j *Job) Src(globs ...string) *Job

Src adds a source globs to this task. The task is not run unless files are outdated between Src and Dest globs.

func (*Job) Wait
func (j *Job) Wait(duration time.Duration) *Job

Wait is minimum milliseconds before task can run again

type M
type M map[string]interface{}

M is generic string to interface alias

type Message
type Message struct {
	Event string
	Data  string
}

Message are sent on the Events channel

type P
type P []interface{}

P is alias for Parallel

type Parallel
type Parallel []interface{}

Parallel runs jobs in parallel

type Pipeline
type Pipeline struct {
	Assets  []*Asset
	Filters []interface{}
}

Pipeline is a asset flow through which each asset is processed by one or more filters. For text files this could be something as simple as adding a header or minification. Some filters process assets in batches combining them, for example concatenating JavaScript or CSS.

func NewPipeline
func NewPipeline() *Pipeline
func Pipe
func Pipe(filters ...interface{}) (*Pipeline, error)

Pipe creates a pipeline with filters and runs it.

func (*Pipeline) AddAsset
func (pipeline *Pipeline) AddAsset(asset *Asset)

AddAsset adds an asset

func (*Pipeline) Pipe
func (pipeline *Pipeline) Pipe(filters ...interface{}) *Pipeline

Pipe adds one or more filters to the pipeline. Pipe may be called more than once.

Filters are simple function. Options are handle through closures. The supported handlers are

  1. Single asset handler. Use this to transorm each asset individually.

    AddHeader filter is an example.

    // signature func(*pipeline.Asset) error

  2. Multi asset handler. Does not modify the number of elements. See

    Write filter is an example.

    // signature func(assets []*pipeline.Asset) error

  3. Pipeline handler. Use this to have unbridled control. Load filter

    is an example.

    // signature func(*Pipeline) error

func (*Pipeline) Run
func (pipeline *Pipeline) Run()

Run runs assets through the pipeline.

func (*Pipeline) Truncate
func (pipeline *Pipeline) Truncate()

Truncate removes all assets, resetting Assets to empty slice.

type Project
type Project struct {
	sync.Mutex
	Jobs      map[string]*Job
	Namespace map[string]*Project
}

Project is a container for tasks.

func NewProject
func NewProject(tasksFunc func(*Project), exitFn func(code int), argm minimist.ArgMap) *Project

NewProject creates am empty project ready for tasks.

func (*Project) Define
func (project *Project) Define(fn func(*Project))

Define defines tasks

func (*Project) Exit
func (project *Project) Exit(code int)

Exit quits the project.

func (*Project) Func
func (project *Project) Func(name string, dependencies Dependency, handler func(*Context)) *Job

Task adds a task to the project with dependencies and handler.

func (*Project) Func1
func (project *Project) Func1(name string, handler func(*Context)) *Job

Do1 adds a simple task to the project.

func (*Project) FuncD
func (project *Project) FuncD(name string, dependencies Dependency) *Job

TaskD adds a task which runs other dependencies with no handler.

func (*Project) Run
func (project *Project) Run(name string) error

Run runs a task by name.

func (*Project) Use
func (project *Project) Use(namespace string, tasksFunc func(*Project))

Use uses another project's task within a namespace.

func (*Project) Watch
func (project *Project) Watch(names []string, isParent bool) bool

Watch watches the Files of a task and reruns the task on a watch event. Any direct dependency is also watched. Returns true if watching.

TODO: 1. Only the parent task watches, but it gathers wath info from all dependencies.

  1. Anything without src files always run when a dependency is triggered by a glob match.

    build [generate{*.go} compile] => go file changes => build, generate and compile

  2. Tasks with src only run if it matches a src

    build [generate{.go} css{.scss} compile] => go file changes => build, generate and compile css does not need to run since no SCSS files ran

X depends on [A:txt, B] => txt changes A runs, X runs without deps X:txt on [A, B] => txt changes A, B, X runs

type S
type S []interface{}

S is alias for Series

type Series
type Series []interface{}

Series are dependent jobs which must run in series.

Documentation

Index

Constants

View Source
const (
	// CaptureStdout is a bitmask to capture STDOUT
	CaptureStdout = 1
	// CaptureStderr is a bitmask to capture STDERR
	CaptureStderr = 2
	// CaptureBoth captures STDOUT and STDERR
	CaptureBoth = CaptureStdout + CaptureStderr
)

Variables

View Source
var (

	// WaitMs is the default time (1500 ms) to debounce task events in watch mode.
	Wait            time.Duration
	RunnerWaitGroup = &wait.WaitGroupN{}
)

Env is the default environment to use for all commands. That is, the effective environment for all commands is the merged set of (parent environment, Env, func specified environment). Whitespace or newline separate key value pairs. $VAR interpolation is allowed.

Env = "GOOS=linux GOARCH=amd64" Env = `

GOOS=linux
GOPATH=./vendor:$GOPATH

`

View Source
var InheritParentEnv bool

InheritParentEnv whether to inherit parent's environment

View Source
var PathListSeparator = "::"

PathListSeparator is a cross-platform path list separator. On Windows, PathListSeparator is replacd by ";". On others, PathListSeparator is replaced by ":"

View Source
var Processes = make(map[string]*os.Process)

Processes are the processes spawned by Start()

View Source
var Verbose = false

Verbose indicates whether to log verbosely

View Source
var Version = "v0.0.1"

Version is the current version

Functions

func Bash

func Bash(script string, options ...map[string]interface{}) (string, error)

Bash executes a bash script (string).

func BashOutput

func BashOutput(script string, options ...map[string]interface{}) (string, error)

BashOutput executes a bash script and returns the output

func EffectiveEnv

func EffectiveEnv(funcEnv []string) []string

EffectiveEnv is the effective environment for an exec function.

func GetAndWrite

func GetAndWrite(src string, writer io.Writer, opts ...getter.ClientOption)

func GetWatchDelay

func GetWatchDelay() time.Duration

GetWatchDelay gets the watch delay

func Getenv

func Getenv(key string) string

Getenv environment variable from a string array.

func GoThrottle

func GoThrottle(throttle int, fns ...func() error) error

GoThrottle starts to run the given list of fns concurrently, at most n fns at a time.

func Halt

func Halt(v interface{})

Halt is a soft panic and stops a task.

func Inside

func Inside(dir string, lambda func()) error

Inside temporarily changes the working directory and restores it when lambda finishes.

func Load

func Load(src, dest string)

func ParseStringEnv

func ParseStringEnv(s string) []string

ParseStringEnv parse the package Env string and converts it into an environment slice.

func ProgressBarConfig

func ProgressBarConfig(bar *pb.ProgressBar, prefix string)

func Prompt

func Prompt(prompt string) string

Prompt prompts user for input with default value.

func PromptPassword

func PromptPassword(prompt string) string

PromptPassword prompts user for password input.

func Run

func Run(commandstr string, options ...map[string]interface{}) (string, error)

Run runs a command.

func RunOutput

func RunOutput(commandstr string, options ...map[string]interface{}) (string, error)

RunOutput runs a command and returns output.

func SetEnviron

func SetEnviron(envstr string, inheritParent bool)

SetEnviron sets the environment for child processes. Note that SetEnviron(Env, InheritParentEnv) is called once automatically.

func SetWatchDelay

func SetWatchDelay(delay time.Duration)

SetWatchDelay sets the time duration between watches.

func Shell

func Shell(args ...string) (stdout string, err error)

func ShellOutput

func ShellOutput(args ...string) (stdout []byte, err error)

func Start

func Start(commandstr string, options ...map[string]interface{}) error

Start starts an async command. If executable has suffix ".go" then it will be "go install"ed then executed. Use this for watching a server task.

If Start is called with the same command it kills the previous process.

The working directory is optional.

func Stencil

func Stencil(tasksFunc func(*Project))

Stencil runs a project of tasks.

func Usage

func Usage(tasks string)

Usage prints a usage screen with task descriptions.

Types

type Asset

type Asset struct {
	bytes.Buffer
	Info *gofs.FileAsset
	// WritePath is the write destination of the asset.
	WritePath string
	Pipeline  *Pipeline
	// contains filtered or unexported fields
}

Asset is any file which can be loaded and processed by a filter.

func (*Asset) ChangeExt

func (asset *Asset) ChangeExt(newExt string)

ChangeExt changes the extension of asset.WritePath. ChangExt is used by filters which transpile source. For example, a filter for Markdown would use ChangeExt(".html") to write the asset as an HTML file.

func (*Asset) Dump

func (asset *Asset) Dump() string

Dump returns a console friendly representation of asset. Note, String() returns the string value of Buffer.

func (*Asset) Ext

func (asset *Asset) Ext() string

Ext returns the extension of asset.WritePath.

func (*Asset) IsText

func (asset *Asset) IsText() bool

IsText return true if it thinks this asset is text based, meaning it can be manipulated with string functions.

func (*Asset) MimeType

func (asset *Asset) MimeType() string

MimeType returns an educated guess of the content type of asset.

func (*Asset) Rewrite

func (asset *Asset) Rewrite(bytes []byte)

Rewrite sets the buffer to bytes.

func (*Asset) RewriteString

func (asset *Asset) RewriteString(s string)

RewriteString sets the buffer to a string value.

type Context

type Context struct {
	// Task is the currently running task.
	Job *Job

	Pipeline *Pipeline

	// FileEvent is an event from the watcher with change details.
	FileEvent *watcher.FileEvent

	// Task command line arguments
	Args minimist.ArgMap

	Error error
}

Context is the data passed to a task.

func (*Context) AnyFile

func (context *Context) AnyFile() []string

AnyFile returns either a non-DELETe FileEvent file or the WatchGlob patterns which can be used by goa.Load()

func (*Context) Bash

func (context *Context) Bash(cmd string, options ...map[string]interface{})

Bash runs a bash shell.

func (*Context) BashOutput

func (context *Context) BashOutput(script string, options ...map[string]interface{}) string

BashOutput executes a bash script and returns the output

func (*Context) Check

func (context *Context) Check(err error, msg string)

Check halts the task if err is not nil.

Do this

Check(err, "Some error occured")

Instead of

if err != nil {
	Halt(err)
}

func (*Context) Pipe

func (context *Context) Pipe(filters ...interface{})

Bash runs a bash shell.

func (*Context) Run

func (context *Context) Run(cmd string, options ...map[string]interface{})

Run runs a command

func (*Context) RunOutput

func (context *Context) RunOutput(commandstr string, options ...map[string]interface{}) string

RunOutput runs a command and returns output.

func (*Context) Start

func (context *Context) Start(cmd string, options ...map[string]interface{})

Start run aysnchronously.

type Dependency

type Dependency interface {
	// contains filtered or unexported methods
}

Dependency marks an interface as a dependency.

type Handler

type Handler interface {
	Handle(*Context)
}

Handler is the interface which all task handlers eventually implement.

type HandlerFunc

type HandlerFunc func(*Context)

HandlerFunc is a Handler adapter.

func (HandlerFunc) Handle

func (f HandlerFunc) Handle(ctx *Context)

Handle implements Handler.

type Job

type Job struct {
	Name string

	Handler Handler

	// computed based on dependencies
	EffectiveWatchRegexps []*gofs.RegexpInfo
	EffectiveWatchGlobs   []string

	// Complete indicates whether this task has already ran. This flag is
	// ignored in watch mode.
	Complete bool

	RunOnce bool

	SrcFiles   []*gofs.FileAsset
	SrcGlobs   []string
	SrcRegexps []*gofs.RegexpInfo

	DestFiles   []*gofs.FileAsset
	DestGlobs   []string
	DestRegexps []*gofs.RegexpInfo

	// used when a file event is received between debounce intervals, the file event
	// will queue itself and set this flag and force debounce to run it
	// when time has elapsed
	sync.Mutex
	// contains filtered or unexported fields
}

A Task is an operation performed on a user's project directory.

func NewJob

func NewJob(name string, argm minimist.ArgMap) *Job

NewTask creates a new Task.

func (*Job) DependencyNames

func (j *Job) DependencyNames() []string

DependencyNames gets the flattened dependency names.

func (*Job) Deps

func (j *Job) Deps(names ...interface{})

Deps are task dependencies and must specify how to run jobs in series or in parallel.

func (*Job) Desc

func (j *Job) Desc(desc string) *Job

Desc is alias for Description.

func (*Job) Description

func (j *Job) Description(desc string) *Job

Description sets the description for the task.

func (*Job) Dest

func (j *Job) Dest(globs ...string) *Job

Dest adds target globs which are used to calculated outdated files. The jobs is not run unless ANY file Src are newer than ANY in DestN.

func (*Job) Run

func (j *Job) Run() error

Run runs all the dependencies of this job and when they have completed, runs this job.

func (*Job) RunWithEvent

func (j *Job) RunWithEvent(logName string, e *watcher.FileEvent) (err error)

RunWithEvent runs this task when triggered from a watch. *e* FileEvent contains information about the file/directory which changed in watch mode.

func (*Job) Src

func (j *Job) Src(globs ...string) *Job

Src adds a source globs to this task. The task is not run unless files are outdated between Src and Dest globs.

func (*Job) Wait

func (j *Job) Wait(duration time.Duration) *Job

Wait is minimum milliseconds before task can run again

type M

type M map[string]interface{}

M is generic string to interface alias

type Message

type Message struct {
	Event string
	Data  string
}

Message are sent on the Events channel

type P

type P []interface{}

P is alias for Parallel

type Parallel

type Parallel []interface{}

Parallel runs jobs in parallel

type Pipeline

type Pipeline struct {
	Assets  []*Asset
	Filters []interface{}
}

Pipeline is a asset flow through which each asset is processed by one or more filters. For text files this could be something as simple as adding a header or minification. Some filters process assets in batches combining them, for example concatenating JavaScript or CSS.

func NewPipeline

func NewPipeline() *Pipeline

func Pipe

func Pipe(filters ...interface{}) (*Pipeline, error)

Pipe creates a pipeline with filters and runs it.

func (*Pipeline) AddAsset

func (pipeline *Pipeline) AddAsset(asset *Asset)

AddAsset adds an asset

func (*Pipeline) Pipe

func (pipeline *Pipeline) Pipe(filters ...interface{}) *Pipeline

Pipe adds one or more filters to the pipeline. Pipe may be called more than once.

Filters are simple function. Options are handle through closures. The supported handlers are

  1. Single asset handler. Use this to transorm each asset individually. AddHeader filter is an example.

    // signature func(*pipeline.Asset) error

  1. Multi asset handler. Does not modify the number of elements. See Write filter is an example.

    // signature func(assets []*pipeline.Asset) error

  1. Pipeline handler. Use this to have unbridled control. Load filter is an example.

    // signature func(*Pipeline) error

func (*Pipeline) Run

func (pipeline *Pipeline) Run()

Run runs assets through the pipeline.

func (*Pipeline) Truncate

func (pipeline *Pipeline) Truncate()

Truncate removes all assets, resetting Assets to empty slice.

type ProgressBar

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

func (*ProgressBar) TrackProgress

func (cpb *ProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser

type Project

type Project struct {
	sync.Mutex
	Jobs      map[string]*Job
	Namespace map[string]*Project
	// contains filtered or unexported fields
}

Project is a container for tasks.

func NewProject

func NewProject(tasksFunc func(*Project), exitFn func(code int), argm minimist.ArgMap) *Project

NewProject creates am empty project ready for tasks.

func (*Project) Define

func (project *Project) Define(fn func(*Project))

Define defines tasks

func (*Project) Exit

func (project *Project) Exit(code int)

Exit quits the project.

func (*Project) Func

func (project *Project) Func(name string, dependencies Dependency, handler func(*Context)) *Job

Task adds a task to the project with dependencies and handler.

func (*Project) Func1

func (project *Project) Func1(name string, handler func(*Context)) *Job

Do1 adds a simple task to the project.

func (*Project) FuncD

func (project *Project) FuncD(name string, dependencies Dependency) *Job

TaskD adds a task which runs other dependencies with no handler.

func (*Project) Run

func (project *Project) Run(name string) error

Run runs a task by name.

func (*Project) Use

func (project *Project) Use(namespace string, tasksFunc func(*Project))

Use uses another project's task within a namespace.

func (*Project) Watch

func (project *Project) Watch(names []string, isParent bool) bool

Watch watches the Files of a task and reruns the task on a watch event. Any direct dependency is also watched. Returns true if watching.

TODO: 1. Only the parent task watches, but it gathers wath info from all dependencies.

2. Anything without src files always run when a dependency is triggered by a gofs match.

build [generate{*.go} compile] => go file changes =>  build, generate and compile

3. Tasks with src only run if it matches a src

build [generate{*.go} css{*.scss} compile] => go file changes => build, generate and compile
css does not need to run since no SCSS files ran

X depends on [A:txt, B] => txt changes A runs, X runs without deps X:txt on [A, B] => txt changes A, B, X runs

type S

type S []interface{}

S is alias for Series

type Series

type Series []interface{}

Series are dependent jobs which must run in series.

Directories

Path Synopsis
app
api
Package filter contains useful filters to be used in a pipeline.
Package filter contains useful filters to be used in a pipeline.
test
app

Jump to

Keyboard shortcuts

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