Skip to content

Commit a52d418

Browse files
committed
Improve clean target with better error handling and file reporting
1 parent a61b832 commit a52d418

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ test: test-swift
55
test-swift:
66
swift test --parallel
77

8+
# Remove build artifacts while tolerating SourceKit-locked files
89
clean:
9-
rm -rf .build
10+
@echo "Cleaning build artifacts..."
11+
@rm -rf .build/* 2>&1 | grep -v "Permission denied" || true
12+
@echo "Checking remaining build artifacts..."
13+
@if [ -d .build ]; then \
14+
ls -R .build 2>/dev/null || echo "Unable to list some directories"; \
15+
else \
16+
echo "Build directory completely removed"; \
17+
fi
18+
@echo "Build artifacts cleaned (ensure that any remaining files listed above won't affect new builds, e.g. SourceKit files)"
1019

1120
test-swift-syntax-versions:
1221
@for version in \

0 commit comments

Comments
 (0)