Fix BlockUntilExists for relative paths.
filepath.Dir("foo") returns ".", so the inotify events are of the form "./foo", which is not equal to the filename being watched ("foo")
This commit is contained in:
parent
0da4e86639
commit
760f3e6edc
|
@ -46,7 +46,7 @@ func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error {
|
||||||
case evt, ok := <-fw.w.Event:
|
case evt, ok := <-fw.w.Event:
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("inotify watcher has been closed")
|
return fmt.Errorf("inotify watcher has been closed")
|
||||||
} else if evt.Name == fw.Filename {
|
} else if filepath.Base(evt.Name) == filepath.Base(fw.Filename) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
case <-t.Dying():
|
case <-t.Dying():
|
||||||
|
|
Loading…
Reference in New Issue