#144 fixed
This commit is contained in:
parent
40d1d0d889
commit
eb03861e9d
|
@ -288,8 +288,6 @@ L:
|
||||||
log.Println("Event:", event, "File:", event.Name, "LastFile:", p.lastFile, "Time:", time.Now(), "LastTime:", p.lastTime)
|
log.Println("Event:", event, "File:", event.Name, "LastFile:", p.lastFile, "Time:", time.Now(), "LastTime:", p.lastTime)
|
||||||
}
|
}
|
||||||
if time.Now().Truncate(time.Second).After(p.lastTime) || event.Name != p.lastFile {
|
if time.Now().Truncate(time.Second).After(p.lastTime) || event.Name != p.lastFile {
|
||||||
// event time
|
|
||||||
eventTime := time.Now()
|
|
||||||
// switch event type
|
// switch event type
|
||||||
switch event.Op {
|
switch event.Op {
|
||||||
case fsnotify.Chmod:
|
case fsnotify.Chmod:
|
||||||
|
@ -311,7 +309,7 @@ L:
|
||||||
if fi.IsDir() {
|
if fi.IsDir() {
|
||||||
filepath.Walk(event.Name, p.walk)
|
filepath.Walk(event.Name, p.walk)
|
||||||
} else {
|
} else {
|
||||||
if event.Op != fsnotify.Write || (!eventTime.Truncate(time.Millisecond).Before(fi.ModTime().Truncate(time.Millisecond)) || event.Name != p.lastFile) {
|
if event.Op != fsnotify.Write || event.Name != p.lastFile {
|
||||||
// stop and restart
|
// stop and restart
|
||||||
close(p.stop)
|
close(p.stop)
|
||||||
p.stop = make(chan bool)
|
p.stop = make(chan bool)
|
||||||
|
@ -366,7 +364,7 @@ func (p *Project) Validate(path string, fiche bool) bool {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if fi.IsDir() || (!fi.IsDir() && fi.Size() > 0) {
|
if fi.Size() > 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue