Skip to content

Commit 25db602

Browse files
authored
Merge pull request #297 from arexon/fsnotify-dir-watcher
Switch to fsnotify for watch mode
2 parents e51e376 + e66dcdb commit 25db602

File tree

10 files changed

+177
-220
lines changed

10 files changed

+177
-220
lines changed

CREDITS.csv

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,26 @@
1-
cloud.google.com/go/compute/metadata,https://github.com/googleapis/google-cloud-go/blob/compute/v1.5.0/compute/LICENSE,Apache-2.0
2-
cloud.google.com/go/iam,https://github.com/googleapis/google-cloud-go/blob/iam/v0.3.0/iam/LICENSE,Apache-2.0
3-
cloud.google.com/go/internal,https://github.com/googleapis/google-cloud-go/blob/v0.100.2/LICENSE,Apache-2.0
4-
cloud.google.com/go/storage,https://github.com/googleapis/google-cloud-go/blob/storage/v1.21.0/storage/LICENSE,Apache-2.0
51
github.com/Bedrock-OSS/go-burrito/burrito,https://github.com/Bedrock-OSS/go-burrito/blob/v1.0.3/LICENSE,MIT
62
github.com/Bedrock-OSS/regolith,https://github.com/Bedrock-OSS/regolith/blob/HEAD/LICENSE,MIT
73
github.com/alessio/shellescape,https://github.com/alessio/shellescape/blob/v1.4.1/LICENSE,MIT
84
github.com/antlr/antlr4/runtime/Go/antlr/v4,https://github.com/antlr/antlr4/blob/76fa05c21b12/runtime/Go/antlr/v4/LICENSE,BSD-3-Clause
9-
github.com/aws/aws-sdk-go,https://github.com/aws/aws-sdk-go/blob/v1.43.25/LICENSE.txt,Apache-2.0
10-
github.com/aws/aws-sdk-go/internal/sync/singleflight,https://github.com/aws/aws-sdk-go/blob/v1.43.25/internal/sync/singleflight/LICENSE,BSD-3-Clause
11-
github.com/bgentry/go-netrc/netrc,https://github.com/bgentry/go-netrc/blob/9fd32a8b3d3d/LICENSE,MIT
5+
github.com/arexon/fsnotify,https://github.com/arexon/fsnotify/blob/1ebdc44d4bc2/LICENSE,BSD-3-Clause
126
github.com/fatih/color,https://github.com/fatih/color/blob/v1.14.1/LICENSE.md,MIT
137
github.com/gammazero/deque,https://github.com/gammazero/deque/blob/v0.2.1/LICENSE,MIT
14-
github.com/golang/groupcache/lru,https://github.com/golang/groupcache/blob/41bb18bfe9da/LICENSE,Apache-2.0
15-
github.com/golang/protobuf,https://github.com/golang/protobuf/blob/v1.5.2/LICENSE,BSD-3-Clause
16-
github.com/google/go-cmp/cmp,https://github.com/google/go-cmp/blob/v0.5.8/LICENSE,BSD-3-Clause
178
github.com/google/go-github/v39/github,https://github.com/google/go-github/blob/v39.2.0/LICENSE,BSD-3-Clause
189
github.com/google/go-querystring/query,https://github.com/google/go-querystring/blob/v1.1.0/LICENSE,BSD-3-Clause
19-
github.com/googleapis/gax-go/v2,https://github.com/googleapis/gax-go/blob/v2.2.0/v2/LICENSE,BSD-3-Clause
20-
github.com/hashicorp/go-cleanhttp,https://github.com/hashicorp/go-cleanhttp/blob/v0.5.2/LICENSE,MPL-2.0
21-
github.com/hashicorp/go-getter,https://github.com/arikkfir/go-getter/blob/281b7670b734/LICENSE,MPL-2.0
22-
github.com/hashicorp/go-safetemp,https://github.com/hashicorp/go-safetemp/blob/v1.0.0/LICENSE,MPL-2.0
23-
github.com/hashicorp/go-version,https://github.com/hashicorp/go-version/blob/v1.4.0/LICENSE,MPL-2.0
24-
github.com/jmespath/go-jmespath,https://github.com/jmespath/go-jmespath/blob/v0.4.0/LICENSE,Apache-2.0
25-
github.com/klauspost/compress,https://github.com/klauspost/compress/blob/v1.15.1/LICENSE,Apache-2.0
26-
github.com/klauspost/compress/internal/snapref,https://github.com/klauspost/compress/blob/v1.15.1/internal/snapref/LICENSE,BSD-3-Clause
27-
github.com/klauspost/compress/zstd/internal/xxhash,https://github.com/klauspost/compress/blob/v1.15.1/zstd/internal/xxhash/LICENSE.txt,MIT
2810
github.com/mattn/go-colorable,https://github.com/mattn/go-colorable/blob/v0.1.13/LICENSE,MIT
2911
github.com/mattn/go-isatty,https://github.com/mattn/go-isatty/blob/v0.0.17/LICENSE,MIT
30-
github.com/mitchellh/go-homedir,https://github.com/mitchellh/go-homedir/blob/v1.1.0/LICENSE,MIT
31-
github.com/mitchellh/go-testing-interface,https://github.com/mitchellh/go-testing-interface/blob/v1.14.1/LICENSE,MIT
3212
github.com/muhammadmuzzammil1998/jsonc,https://github.com/muhammadmuzzammil1998/jsonc/blob/v1.0.0/LICENSE,MIT
3313
github.com/nightlyone/lockfile,https://github.com/nightlyone/lockfile/blob/v1.0.0/LICENSE,MIT
3414
github.com/otiai10/copy,https://github.com/otiai10/copy/blob/v1.7.0/LICENSE,MIT
3515
github.com/paul-mannino/go-fuzzywuzzy,https://github.com/paul-mannino/go-fuzzywuzzy/blob/54652b135d0e/LICENSE,GPL-3.0
3616
github.com/spf13/cobra,https://github.com/spf13/cobra/blob/v1.6.1/LICENSE.txt,Apache-2.0
3717
github.com/spf13/pflag,https://github.com/spf13/pflag/blob/v1.0.5/LICENSE,BSD-3-Clause
3818
github.com/stirante/go-simple-eval,https://github.com/stirante/go-simple-eval/blob/9ed520afbec1/LICENSE,GPL-3.0
39-
github.com/ulikunitz/xz,https://github.com/ulikunitz/xz/blob/v0.5.10/LICENSE,BSD-3-Clause
40-
go.opencensus.io,https://github.com/census-instrumentation/opencensus-go/blob/v0.23.0/LICENSE,Apache-2.0
4119
go.uber.org/atomic,https://github.com/uber-go/atomic/blob/v1.9.0/LICENSE.txt,MIT
4220
go.uber.org/multierr,https://github.com/uber-go/multierr/blob/v1.8.0/LICENSE.txt,MIT
4321
go.uber.org/zap,https://github.com/uber-go/zap/blob/v1.23.0/LICENSE.txt,MIT
4422
golang.org/x/crypto,https://cs.opensource.google/go/x/crypto/+/v0.1.0:LICENSE,BSD-3-Clause
4523
golang.org/x/exp,https://cs.opensource.google/go/x/exp/+/aae9b4e6:LICENSE,BSD-3-Clause
4624
golang.org/x/mod/semver,https://cs.opensource.google/go/x/mod/+/v0.6.0:LICENSE,BSD-3-Clause
47-
golang.org/x/net,https://cs.opensource.google/go/x/net/+/v0.1.0:LICENSE,BSD-3-Clause
48-
golang.org/x/oauth2,https://cs.opensource.google/go/x/oauth2/+/6242fa91:LICENSE,BSD-3-Clause
49-
golang.org/x/sys/unix,https://cs.opensource.google/go/x/sys/+/v0.4.0:LICENSE,BSD-3-Clause
25+
golang.org/x/sys/unix,https://cs.opensource.google/go/x/sys/+/v0.13.0:LICENSE,BSD-3-Clause
5026
golang.org/x/text,https://cs.opensource.google/go/x/text/+/v0.6.0:LICENSE,BSD-3-Clause
51-
golang.org/x/xerrors,https://cs.opensource.google/go/x/xerrors/+/5ec99f83:LICENSE,BSD-3-Clause
52-
google.golang.org/api,https://github.com/googleapis/google-api-go-client/blob/v0.73.0/LICENSE,BSD-3-Clause
53-
google.golang.org/api/internal/third_party/uritemplates,https://github.com/googleapis/google-api-go-client/blob/v0.73.0/internal/third_party/uritemplates/LICENSE,BSD-3-Clause
54-
google.golang.org/genproto/googleapis,https://github.com/googleapis/go-genproto/blob/acbaeb5b85eb/LICENSE,Apache-2.0
55-
google.golang.org/grpc,https://github.com/grpc/grpc-go/blob/v1.45.0/LICENSE,Apache-2.0
56-
google.golang.org/protobuf,https://github.com/protocolbuffers/protobuf-go/blob/v1.28.0/LICENSE,BSD-3-Clause

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/stirante/go-simple-eval v0.0.0-20230131075324-9ed520afbec1
1717
go.uber.org/zap v1.23.0
1818
golang.org/x/mod v0.6.0
19-
golang.org/x/sys v0.4.0
19+
golang.org/x/sys v0.13.0
2020
)
2121

2222
replace github.com/hashicorp/go-getter => github.com/arikkfir/go-getter v1.6.3-0.20220803164326-281b7670b734
@@ -27,6 +27,7 @@ require (
2727
cloud.google.com/go/iam v0.3.0 // indirect
2828
cloud.google.com/go/storage v1.21.0 // indirect
2929
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20221202181307-76fa05c21b12 // indirect
30+
github.com/arexon/fsnotify v0.0.0-20240929211932-1ebdc44d4bc2 // indirect
3031
github.com/aws/aws-sdk-go v1.43.25 // indirect
3132
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
3233
github.com/gammazero/deque v0.2.1 // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPp
6767
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
6868
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20221202181307-76fa05c21b12 h1:npHgfD4Tl2WJS3AJaMUi5ynGDPUBfkg3U3fCzDyXZ+4=
6969
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20221202181307-76fa05c21b12/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM=
70+
github.com/arexon/fsnotify v0.0.0-20240929211932-1ebdc44d4bc2 h1:Y4fOHCKaIWeRXZ9+qqaB7UI0tjK/eMN6CZ9OCbY3FBY=
71+
github.com/arexon/fsnotify v0.0.0-20240929211932-1ebdc44d4bc2/go.mod h1:fMK1EJDCm6IfeqTBptyizpl356fZy33nWqFKELbFouQ=
7072
github.com/arikkfir/go-getter v1.6.3-0.20220803164326-281b7670b734 h1:csFUhbcumnsC5d0SMF8CvtR6Z/i4UeNgOZ6xUaQUYas=
7173
github.com/arikkfir/go-getter v1.6.3-0.20220803164326-281b7670b734/go.mod h1:IZCrswsZPeWv9IkVnLElzRU/gz/QPi6pZHn4tv6vbwA=
7274
github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM=
@@ -473,6 +475,8 @@ golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBc
473475
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
474476
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
475477
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
478+
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
479+
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
476480
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
477481
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
478482
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

regolith/compatibility_other_os.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,6 @@ func copyFileSecurityInfo(source string, target string) error {
3030
return nil
3131
}
3232

33-
type DirWatcher struct{}
34-
35-
func NewDirWatcher(path string) (*DirWatcher, error) {
36-
return nil, burrito.WrappedError(notImplementedOnThisSystemError)
37-
}
38-
39-
func (d *DirWatcher) WaitForChange() error {
40-
return burrito.WrappedError(notImplementedOnThisSystemError)
41-
}
42-
43-
func (d *DirWatcher) WaitForChangeGroup(
44-
groupTimeout uint32, interruptionChannel chan string,
45-
interruptionMessage string,
46-
) error {
47-
return burrito.WrappedError(notImplementedOnThisSystemError)
48-
}
49-
50-
func (d *DirWatcher) Close() error {
51-
return burrito.WrappedError(notImplementedOnThisSystemError)
52-
}
53-
5433
func FindStandardMojangDir() (string, error) {
5534
comMojang := os.Getenv("COM_MOJANG")
5635
if comMojang == "" {

regolith/compatibility_windows.go

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -53,99 +53,6 @@ func copyFileSecurityInfo(source string, target string) error {
5353
return nil
5454
}
5555

56-
// DirWatcher is a struct that provides easy to use methods for watching a
57-
// directory for changes. It uses FindFirstChangeNotification instead of
58-
// ReadDirectoryChanges, so it doesn't provide any information about the
59-
// changes, only the fact that something changed.
60-
//
61-
// Useful links:
62-
// https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirstchangenotificationa
63-
//
64-
// https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findnextchangenotification
65-
//
66-
// https://pkg.go.dev/golang.org/x/sys@v0.0.0-20220412211240-33da011f77ad/windows
67-
//
68-
// https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-readdirectorychangesw
69-
type DirWatcher struct {
70-
handle windows.Handle
71-
}
72-
73-
// NewDirWatcher creates a new DirWatcher for the given path. It filters out
74-
// some of the less interesting events like FILE_NOTIFY_CHANGE_LAST_ACCESS.
75-
func NewDirWatcher(path string) (*DirWatcher, error) {
76-
var notifyFilter uint32 = (windows.FILE_NOTIFY_CHANGE_FILE_NAME |
77-
windows.FILE_NOTIFY_CHANGE_DIR_NAME |
78-
// windows.FILE_NOTIFY_CHANGE_ATTRIBUTES |
79-
// windows.FILE_NOTIFY_CHANGE_SIZE |
80-
windows.FILE_NOTIFY_CHANGE_LAST_WRITE |
81-
// windows.FILE_NOTIFY_CHANGE_LAST_ACCESS |
82-
// windows.FILE_NOTIFY_CHANGE_SECURITY |
83-
windows.FILE_NOTIFY_CHANGE_CREATION)
84-
handle, err := windows.FindFirstChangeNotification(
85-
path, true, notifyFilter)
86-
if err != nil {
87-
return nil, err
88-
}
89-
return &DirWatcher{handle: handle}, nil
90-
}
91-
92-
// WaitForChange locks the goroutine until a single change is detected. Note
93-
// that some changes are reported multiple times, for example saving a file
94-
// will cause a change to the file and a change to the directory. If you want
95-
// to report cases like that as one event, see WaitForChangeGroup.
96-
func (d *DirWatcher) WaitForChange() error {
97-
_, err := windows.WaitForSingleObject(d.handle, windows.INFINITE)
98-
if err != nil {
99-
return err
100-
}
101-
err = windows.FindNextChangeNotification(d.handle)
102-
if err != nil {
103-
return err
104-
}
105-
return nil
106-
}
107-
108-
// WaitForChangeGroup locks a goroutine until it receives a change notification.
109-
// When that happens it sends the interruptionMessage to the
110-
// interruptionChannel.
111-
// Then it continues locking as long as other changes keep coming with
112-
// intervals less than the given timeout, to group notifications that come
113-
// in short intervals together.
114-
func (d *DirWatcher) WaitForChangeGroup(
115-
groupTimeout uint32, interruptionChannel chan string,
116-
interruptionMessage string,
117-
) error {
118-
err := d.WaitForChange()
119-
if err != nil {
120-
return err
121-
}
122-
// Instantly report the change
123-
interruptionChannel <- interruptionMessage
124-
// Consume all changes for groupDelay duration
125-
for {
126-
event, err := windows.WaitForSingleObject(d.handle, groupTimeout)
127-
if err != nil {
128-
return err
129-
}
130-
// Possible options: WAIT_OBJECT_0, WAIT_ABANDONED, WAIT_TIMEOUT,
131-
// WAIT_FAILED
132-
if event == uint32(windows.WAIT_TIMEOUT) ||
133-
event == uint32(windows.WAIT_ABANDONED) {
134-
break
135-
}
136-
err = windows.FindNextChangeNotification(d.handle)
137-
if err != nil {
138-
return err
139-
}
140-
}
141-
return nil
142-
}
143-
144-
// Close closes DirWatcher handle.
145-
func (d *DirWatcher) Close() error {
146-
return windows.CloseHandle(d.handle)
147-
}
148-
14956
// FindStandardMojangDir returns path to the com.mojang folder in the standard
15057
// Minecraft build.
15158
func FindStandardMojangDir() (string, error) {

regolith/filter.go

Lines changed: 18 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package regolith
22

3-
import "github.com/Bedrock-OSS/go-burrito/burrito"
3+
import (
4+
"github.com/Bedrock-OSS/go-burrito/burrito"
5+
)
46

57
type FilterDefinition struct {
68
Id string `json:"-"`
@@ -23,16 +25,18 @@ type RunContext struct {
2325
DotRegolithPath string
2426
Settings map[string]interface{}
2527

26-
// interruptionChannel is a channel that is used to notify about changes
28+
// interruption is a channel that is used to notify about changes
2729
// in the source files, in order to trigger a restart of the program in
2830
// the watch mode. The string send to the channel is the name of the source
2931
// of the change ("rp", "bp" or "data"), which may be used to handle
3032
// some interruptions differently.
31-
interruptionChannel chan string
33+
interruption chan string
3234

33-
// fileWatchingErrorChannel is used to pass any errors that may occur during
35+
// fileWatchingError is used to pass any errors that may occur during
3436
// file watching.
35-
fileWatchingErrorChannel chan error
37+
fileWatchingError chan error
38+
39+
fileWatchingStage chan string
3640
}
3741

3842
// GetProfile returns the Profile structure from the context.
@@ -48,74 +52,31 @@ func (c *RunContext) GetProfile() (Profile, error) {
4852
// IsInWatchMode returns a value that shows whether the context is in the
4953
// watch mode.
5054
func (c *RunContext) IsInWatchMode() bool {
51-
return c.interruptionChannel == nil
55+
return c.interruption != nil
5256
}
5357

5458
// StartWatchingSourceFiles causes the Context to start goroutines that watch
5559
// for changes in the source files and report that to the
5660
func (c *RunContext) StartWatchingSourceFiles() error {
57-
// TODO - if you want to be able to restart the watcher, you need to handle
58-
// closing the channels somewhere. Currently the watching goroutines yield
59-
// their messages until the end of the program. Sending to a closed channel
60-
// would cause panic.
61-
if c.interruptionChannel != nil {
62-
return burrito.WrappedError("Files are already being watched.")
63-
}
64-
65-
c.interruptionChannel = make(chan string)
66-
c.fileWatchingErrorChannel = make(chan error)
67-
yieldChanges := func(
68-
watcher *DirWatcher, sourceName string,
69-
) {
70-
for {
71-
err := watcher.WaitForChangeGroup(100, c.interruptionChannel, sourceName)
72-
if err != nil {
73-
c.fileWatchingErrorChannel <- err
74-
}
75-
}
76-
}
77-
78-
addWatcher := func(watchedPath, watcherString string) error {
79-
watcher, err := NewDirWatcher(watchedPath)
80-
if err != nil {
81-
return burrito.PassError(err)
82-
}
83-
go yieldChanges(watcher, watcherString)
84-
return nil
85-
}
86-
87-
var err error
88-
if c.Config.ResourceFolder != "" {
89-
err = addWatcher(c.Config.ResourceFolder, "rp")
90-
if err != nil {
91-
return burrito.WrapError(err, "Could not create resource pack watcher.")
92-
}
93-
}
94-
if c.Config.BehaviorFolder != "" {
95-
err = addWatcher(c.Config.BehaviorFolder, "bp")
96-
if err != nil {
97-
return burrito.WrapError(err, "Could not create behavior pack watcher.")
98-
}
61+
c.interruption = make(chan string)
62+
c.fileWatchingError = make(chan error)
63+
c.fileWatchingStage = make(chan string)
64+
err := NewDirWatcher(c.Config, c.interruption, c.fileWatchingError, c.fileWatchingStage)
65+
if err != nil {
66+
return err
9967
}
100-
if c.Config.DataPath != "" {
101-
err = addWatcher(c.Config.DataPath, "data")
102-
if err != nil {
103-
return burrito.WrapError(err, "Could not create data watcher.")
104-
}
105-
}
106-
10768
return nil
10869
}
10970

11071
// IsInterrupted returns true if there is a message on the interruptionChannel
11172
// unless the source of the interruption is on the list of ignored sources.
11273
// This function does not block.
11374
func (c *RunContext) IsInterrupted(ignoredSource ...string) bool {
114-
if c.interruptionChannel == nil {
75+
if c.interruption == nil {
11576
return false
11677
}
11778
select {
118-
case source := <-c.interruptionChannel:
79+
case source := <-c.interruption:
11980
for _, ignored := range ignoredSource {
12081
if ignored == source {
12182
return false

regolith/filter_profile.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ type ProfileFilter struct {
1010
func (f *ProfileFilter) Run(context RunContext) (bool, error) {
1111
Logger.Infof("Running %q nested profile...", f.Profile)
1212
return RunProfileImpl(RunContext{
13-
Profile: f.Profile,
14-
AbsoluteLocation: context.AbsoluteLocation,
15-
Config: context.Config,
16-
Parent: &context,
17-
interruptionChannel: context.interruptionChannel,
18-
DotRegolithPath: context.DotRegolithPath,
19-
Settings: f.Settings,
13+
Profile: f.Profile,
14+
AbsoluteLocation: context.AbsoluteLocation,
15+
Config: context.Config,
16+
Parent: &context,
17+
interruption: context.interruption,
18+
DotRegolithPath: context.DotRegolithPath,
19+
Settings: f.Settings,
2020
})
2121
}
2222

regolith/main_functions.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,11 @@ func Watch(profileName string, debug bool) error {
312312
}
313313
Logger.Info("Press Ctrl+C to stop watching.")
314314
select {
315-
case <-context.interruptionChannel:
315+
case <-context.interruption:
316316
// AwaitInterruption locks the goroutine with the interruption channel until
317317
// the Config is interrupted and returns the interruption message.
318318
Logger.Warn("Restarting...")
319-
case err := <-context.fileWatchingErrorChannel:
319+
case err := <-context.fileWatchingError:
320320
if err != nil {
321321
return burrito.WrapError(err, "Encountered an error during file watching")
322322
}
@@ -380,13 +380,13 @@ func ApplyFilter(filterName string, filterArgs []string, debug bool) error {
380380
// Create run context
381381
path, _ := filepath.Abs(".")
382382
runContext := RunContext{
383-
Config: config,
384-
Parent: nil,
385-
Profile: "[dynamic profile]",
386-
DotRegolithPath: dotRegolithPath,
387-
interruptionChannel: nil,
388-
AbsoluteLocation: path,
389-
Settings: filterRunner.GetSettings(),
383+
Config: config,
384+
Parent: nil,
385+
Profile: "[dynamic profile]",
386+
DotRegolithPath: dotRegolithPath,
387+
interruption: nil,
388+
AbsoluteLocation: path,
389+
Settings: filterRunner.GetSettings(),
390390
}
391391
// Check the filter
392392
err = filterRunner.Check(runContext)

0 commit comments

Comments
 (0)