mirror of
https://github.com/go-task/task.git
synced 2026-06-27 22:54:26 +00:00
Update deps
This commit is contained in:
2
vendor/github.com/radovskyb/watcher/samefile.go
generated
vendored
2
vendor/github.com/radovskyb/watcher/samefile.go
generated
vendored
@@ -4,6 +4,6 @@ package watcher
|
||||
|
||||
import "os"
|
||||
|
||||
func SameFile(fi1, fi2 os.FileInfo) bool {
|
||||
func sameFile(fi1, fi2 os.FileInfo) bool {
|
||||
return os.SameFile(fi1, fi2)
|
||||
}
|
||||
|
||||
2
vendor/github.com/radovskyb/watcher/samefile_windows.go
generated
vendored
2
vendor/github.com/radovskyb/watcher/samefile_windows.go
generated
vendored
@@ -4,7 +4,7 @@ package watcher
|
||||
|
||||
import "os"
|
||||
|
||||
func SameFile(fi1, fi2 os.FileInfo) bool {
|
||||
func sameFile(fi1, fi2 os.FileInfo) bool {
|
||||
return fi1.ModTime() == fi2.ModTime() &&
|
||||
fi1.Size() == fi2.Size() &&
|
||||
fi1.Mode() == fi2.Mode() &&
|
||||
|
||||
9
vendor/github.com/radovskyb/watcher/watcher.go
generated
vendored
9
vendor/github.com/radovskyb/watcher/watcher.go
generated
vendored
@@ -79,6 +79,7 @@ func (e Event) String() string {
|
||||
return "???"
|
||||
}
|
||||
|
||||
// Watcher describes a process that watches files for changes.
|
||||
type Watcher struct {
|
||||
Event chan Event
|
||||
Error chan error
|
||||
@@ -211,7 +212,7 @@ func (w *Watcher) list(name string) (map[string]os.FileInfo, error) {
|
||||
return fileList, nil
|
||||
}
|
||||
|
||||
// Add adds either a single file or directory recursively to the file list.
|
||||
// AddRecursive adds either a single file or directory recursively to the file list.
|
||||
func (w *Watcher) AddRecursive(name string) (err error) {
|
||||
w.mu.Lock()
|
||||
defer w.mu.Unlock()
|
||||
@@ -292,7 +293,7 @@ func (w *Watcher) Remove(name string) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Remove removes either a single file or a directory recursively from
|
||||
// RemoveRecursive removes either a single file or a directory recursively from
|
||||
// the file's list.
|
||||
func (w *Watcher) RemoveRecursive(name string) (err error) {
|
||||
w.mu.Lock()
|
||||
@@ -346,6 +347,7 @@ func (w *Watcher) Ignore(paths ...string) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// WatchedFiles returns a map of files added to a Watcher.
|
||||
func (w *Watcher) WatchedFiles() map[string]os.FileInfo {
|
||||
w.mu.Lock()
|
||||
defer w.mu.Unlock()
|
||||
@@ -560,7 +562,7 @@ func (w *Watcher) pollEvents(files map[string]os.FileInfo, evt chan Event,
|
||||
// Check for renames and moves.
|
||||
for path1, info1 := range removes {
|
||||
for path2, info2 := range creates {
|
||||
if SameFile(info1, info2) {
|
||||
if sameFile(info1, info2) {
|
||||
e := Event{
|
||||
Op: Move,
|
||||
Path: fmt.Sprintf("%s -> %s", path1, path2),
|
||||
@@ -606,6 +608,7 @@ func (w *Watcher) Wait() {
|
||||
w.wg.Wait()
|
||||
}
|
||||
|
||||
// Close stops a Watcher and unlocks its mutex, then sends a close signal.
|
||||
func (w *Watcher) Close() {
|
||||
w.mu.Lock()
|
||||
if !w.running {
|
||||
|
||||
Reference in New Issue
Block a user