This repository was archived by the owner on Aug 30, 2024. It is now read-only.
File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -222,8 +222,17 @@ const (
222
222
// Use this command to debug what wasn't sync'd correctly:
223
223
// rsync -e "coder sh" -nicr ~/Projects/cdr/coder-cli/. ammar:/home/coder/coder-cli/
224
224
func (s Sync ) Run () error {
225
+ events := make (chan notify.EventInfo , maxInflightInotify )
226
+ // Set up a recursive watch.
227
+ // We do this before the initial sync so we can capture any changes that may have happened during sync.
228
+ err := notify .Watch (path .Join (s .LocalDir , "..." ), events , notify .All )
229
+ if err != nil {
230
+ return xerrors .Errorf ("create watch: %w" , err )
231
+ }
232
+ defer notify .Stop (events )
233
+
225
234
setConsoleTitle ("⏳ syncing project" )
226
- err : = s .initSync ()
235
+ err = s .initSync ()
227
236
if err != nil {
228
237
return err
229
238
}
@@ -232,13 +241,6 @@ func (s Sync) Run() error {
232
241
return nil
233
242
}
234
243
235
- events := make (chan notify.EventInfo , maxInflightInotify )
236
- // Set up a recursive watch.
237
- err = notify .Watch (path .Join (s .LocalDir , "..." ), events , notify .All )
238
- if err != nil {
239
- return xerrors .Errorf ("create watch: %w" , err )
240
- }
241
- defer notify .Stop (events )
242
244
243
245
flog .Info ("watching %s for changes" , s .LocalDir )
244
246
You can’t perform that action at this time.
0 commit comments