improved: made watcher paths relative to the config file location
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
abs3nt 2023-03-04 22:28:42 -08:00
parent 01550ac3b3
commit e8237d5458
2 changed files with 2 additions and 3 deletions

View File

@ -128,7 +128,7 @@ func (r *Haunt) SetDefaults() {
},
Watcher: Watch{
Exts: []string{"go"},
Paths: []string{"/"},
Paths: []string{"cmd/" + dir.Name()},
},
})
} else {

View File

@ -120,8 +120,7 @@ func (p *Project) Before() {
p.cmd(p.stop, "before", true)
// indexing files and dirs
for _, dir := range p.Watcher.Paths {
base, _ := filepath.Abs(p.Path)
base = filepath.Join(base, dir)
base, _ := filepath.Abs(dir)
if _, err := os.Stat(base); err == nil {
if err := filepath.Walk(base, p.walk); err != nil {
p.Err(err)