We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdba730 commit e09673cCopy full SHA for e09673c
internal/watcher/watcher.go
100644
100755
@@ -3,10 +3,11 @@ package watcher
3
import (
4
"github.com/fsnotify/fsnotify"
5
"os"
6
+ "os/signal"
7
"path/filepath"
8
"squish/internal/utils"
-
9
"squish/pkg/esbuild"
10
+ "syscall"
11
)
12
13
type Watcher struct {
@@ -64,6 +65,16 @@ func (w *Watcher) Watch() error {
64
65
return err
66
}
67
68
+ // Setup signal handling for graceful shutdown
69
+ signals := make(chan os.Signal, 1)
70
+ signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
71
+
72
+ go func() {
73
+ <-signals
74
+ utils.Log("Received interrupt signal, shutting down watcher...")
75
+ close(done)
76
+ }()
77
78
utils.Log("Watching for changes in", w.srcDir)
79
<-done
80
return nil
0 commit comments