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