Skip to content

Commit a546754

Browse files
authored
fix: correctly send configure--watch file deletion cycles (#266)
While `run --watch` can detect deletions based on how the runfiles manifest changes, deletions of source files requires an actual fs-stat to determine if the file still exists. ### Changes are visible to end-users: no ### Test plan - Covered by existing test cases - Manual testing
1 parent 6569c96 commit a546754

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmd/aspect/configure/configure.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import (
3939
"log"
4040
"net"
4141
"os"
42+
"path"
4243
"slices"
4344
"strconv"
4445
"time"
@@ -328,7 +329,12 @@ func changesetToCycle(cs *watchman.ChangeSet) ibp.SourceInfoMap {
328329
si := &ibp.SourceInfo{IsSource: &b}
329330
changes := make(ibp.SourceInfoMap, len(cs.Paths))
330331
for _, p := range cs.Paths {
331-
changes[p] = si
332+
// Determine if the change is a deletion vs regular change
333+
if _, err := os.Stat(path.Join(cs.Root, p)); err != nil {
334+
changes[p] = nil
335+
} else {
336+
changes[p] = si
337+
}
332338
}
333339
return changes
334340
}

0 commit comments

Comments
 (0)