Skip to content

Commit 9c7f7bc

Browse files
landismndeloof
authored andcommitted
live_update: error if syncing from outside of docker context (docker#1396)
1 parent 6defe7c commit 9c7f7bc

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

pkg/watch/ospath.go

Lines changed: 0 additions & 8 deletions
This file was deleted.

pkg/watch/watcher_darwin.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import (
55
"sync"
66
"time"
77

8+
"github.com/windmilleng/tilt/internal/ospath"
9+
810
"github.com/windmilleng/fsevents"
911
)
1012

@@ -77,8 +79,7 @@ func (d *darwinNotify) Add(name string) error {
7779
// Check if this is a subdirectory of any of the paths
7880
// we're already watching.
7981
for _, parent := range es.Paths {
80-
isChild := pathIsChildOf(name, parent)
81-
if isChild {
82+
if ospath.IsChild(parent, name) {
8283
return nil
8384
}
8485
}

pkg/watch/watcher_naive.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010

1111
"github.com/pkg/errors"
1212
"github.com/windmilleng/fsnotify"
13+
14+
"github.com/windmilleng/tilt/internal/ospath"
1315
)
1416

1517
// A naive file watcher that uses the plain fsnotify API.
@@ -151,7 +153,7 @@ func (d *naiveNotify) shouldNotify(e fsnotify.Event) bool {
151153
} else {
152154
// TODO(dmiller): maybe use a prefix tree here?
153155
for path := range d.notifyList {
154-
if pathIsChildOf(e.Name, path) {
156+
if ospath.IsChild(path, e.Name) {
155157
return true
156158
}
157159
}

0 commit comments

Comments
 (0)