ignore paths

This commit is contained in:
alessio 2016-07-31 23:39:11 +02:00
parent 98a3876a6b
commit 0ebcfebf9d
1 changed files with 8 additions and 5 deletions

View File

@ -13,8 +13,9 @@ import (
const( const(
file = "realize.config.yaml" file = "realize.config.yaml"
ext = "go" ext = ".go"
path = "/" path = "/"
ignore = "vendor"
) )
var green = color.New(color.FgGreen, color.Bold).SprintFunc() var green = color.New(color.FgGreen, color.Bold).SprintFunc()
@ -41,6 +42,7 @@ type Watcher struct{
Before []string `yaml:"before,omitempty"` Before []string `yaml:"before,omitempty"`
After []string `yaml:"after,omitempty"` After []string `yaml:"after,omitempty"`
Paths []string `yaml:"paths,omitempty"` Paths []string `yaml:"paths,omitempty"`
Ignore []string `yaml:"ignore_paths,omitempty"`
Exts []string `yaml:"exts,omitempty"` Exts []string `yaml:"exts,omitempty"`
} }
@ -57,8 +59,9 @@ func New(params *cli.Context) *Config{
Build: params.Bool("build"), Build: params.Bool("build"),
Bin: params.Bool("bin"), Bin: params.Bool("bin"),
Watcher: Watcher{ Watcher: Watcher{
Paths: []string{ext}, Paths: []string{path},
Exts: []string{path}, Ignore: []string{ignore},
Exts: []string{ext},
}, },
}, },
}, },
@ -133,8 +136,8 @@ func (h *Config) Add(params *cli.Context) error{
Run: params.Bool("run"), Run: params.Bool("run"),
Build: params.Bool("build"), Build: params.Bool("build"),
Watcher: Watcher{ Watcher: Watcher{
Paths: []string{ext}, Paths: []string{path},
Exts: []string{path}, Exts: []string{ext},
}, },
} }
if Duplicates(new, h.Projects) { if Duplicates(new, h.Projects) {