improved: made watcher paths relative to the config file location
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
01550ac3b3
commit
e8237d5458
@ -128,7 +128,7 @@ func (r *Haunt) SetDefaults() {
|
|||||||
},
|
},
|
||||||
Watcher: Watch{
|
Watcher: Watch{
|
||||||
Exts: []string{"go"},
|
Exts: []string{"go"},
|
||||||
Paths: []string{"/"},
|
Paths: []string{"cmd/" + dir.Name()},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
@ -120,8 +120,7 @@ func (p *Project) Before() {
|
|||||||
p.cmd(p.stop, "before", true)
|
p.cmd(p.stop, "before", true)
|
||||||
// indexing files and dirs
|
// indexing files and dirs
|
||||||
for _, dir := range p.Watcher.Paths {
|
for _, dir := range p.Watcher.Paths {
|
||||||
base, _ := filepath.Abs(p.Path)
|
base, _ := filepath.Abs(dir)
|
||||||
base = filepath.Join(base, dir)
|
|
||||||
if _, err := os.Stat(base); err == nil {
|
if _, err := os.Stat(base); err == nil {
|
||||||
if err := filepath.Walk(base, p.walk); err != nil {
|
if err := filepath.Walk(base, p.walk); err != nil {
|
||||||
p.Err(err)
|
p.Err(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user