@@ -24,7 +24,8 @@ class LiveSyncService implements ILiveSyncService {
24
24
private $options : IOptions ,
25
25
private $logger : ILogger ,
26
26
private $dispatcher : IFutureDispatcher ,
27
- private $hooksService : IHooksService ) { }
27
+ private $hooksService : IHooksService ,
28
+ private $processService : IProcessService ) { }
28
29
29
30
private ensureAndroidFrameworkVersion ( platformData : IPlatformData ) : IFuture < void > { // TODO: this can be moved inside command or canExecute function
30
31
return ( ( ) => {
@@ -130,7 +131,7 @@ class LiveSyncService implements ILiveSyncService {
130
131
private partialSync ( syncWorkingDirectory : string , onChangedActions : ( ( event : string , filePath : string , dispatcher : IFutureDispatcher ) => void ) [ ] ) : void {
131
132
let that = this ;
132
133
133
- gaze ( "**/*" , { cwd : syncWorkingDirectory } , function ( err : any , watcher : any ) {
134
+ let gazeWatcher = gaze ( "**/*" , { cwd : syncWorkingDirectory } , function ( err : any , watcher : any ) {
134
135
this . on ( 'all' , ( event : string , filePath : string ) => {
135
136
fiberBootstrap . run ( ( ) => {
136
137
that . $dispatcher . dispatch ( ( ) => ( ( ) => {
@@ -147,6 +148,7 @@ class LiveSyncService implements ILiveSyncService {
147
148
} ) ;
148
149
} ) ;
149
150
151
+ this . $processService . attachToProcessExitSignals ( this , gazeWatcher . close ) ;
150
152
this . $dispatcher . run ( ) ;
151
153
}
152
154
}
0 commit comments