Skip to content

Commit

Permalink
dev: exit sst dev when branch is switched
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr committed Sep 2, 2024
1 parent dd38fa0 commit f2b8db4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/sst/mosaic/watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,18 @@ func Start(ctx context.Context, root string) error {
return err
}

headFile := filepath.Join(root, ".git/HEAD")
watcher.Add(headFile)
limiter := map[string]time.Time{}
for {
select {
case event, ok := <-watcher.Events:
if !ok {
return nil
}
if event.Name == headFile {
return nil
}
if event.Op&(fsnotify.Write|fsnotify.Create) == 0 {
slog.Info("ignoring file event", "path", event.Name, "op", event.Op)
continue
Expand Down

0 comments on commit f2b8db4

Please sign in to comment.