watchcmd

package
v2.0.0-beta.13 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(path string, patterns []string) bool

Match checks if the path matches the patterns logic. Patterns can include inclusion patterns and exclusion patterns (starting with !). Exclusions take precedence. If no inclusion patterns are present, it implies matching everything (unless excluded).

func MatchAny

func MatchAny(path string, patterns []string) bool

MatchAny checks if path matches any of the provided patterns. It supports doublestar syntax. If a pattern contains path separators, it matches against the full path. Otherwise, it matches against the base filename.

func New

func New() *redant.Command

func SplitPatterns

func SplitPatterns(patterns []string) (includes, excludes []string)

SplitPatterns splits patterns into includes and excludes. Patterns starting with '!' are considered excludes (with '!' stripped).

Types

type Config

type Config struct {
	Watch WatchConfig `yaml:"watch"`
}

type WatchConfig

type WatchConfig struct {
	Watchers []WatcherConfig `yaml:"watchers"`
}

type WatcherConfig

type WatcherConfig struct {
	Name           string   `yaml:"name"`
	Directory      string   `yaml:"directory"`
	Patterns       []string `yaml:"patterns"`
	Commands       []string `yaml:"commands"`
	Ignore         []string `yaml:"ignore"`
	IgnorePatterns []string `yaml:"ignore_patterns"`
	RunOnStartup   bool     `yaml:"run_on_startup"`
	Timeout        int      `yaml:"timeout"`
}

Jump to

Keyboard shortcuts

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