1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 22:30:08 +00:00

refactor(purge): improve React Native targets safety and clarity

- Clarify .cxx comment to indicate React Native NDK build cache
- Add protection for Xcode global DerivedData in ~/Library/Developer/Xcode/
  to prevent accidental deletion of shared build artifacts

Refs: #461
This commit is contained in:
tw93
2026-02-16 15:39:00 +08:00
parent db0b3a967a
commit 685aa8b970

View File

@@ -42,7 +42,7 @@ readonly PURGE_TARGETS=(
"coverage" # Code coverage reports
"DerivedData" # Xcode
"Pods" # CocoaPods
".cxx" # Android
".cxx" # React Native Android NDK build cache
".expo" # Expo
)
# Minimum age in days before considering for cleanup.
@@ -328,6 +328,12 @@ is_protected_purge_artifact() {
is_protected_vendor_dir "$path"
return $?
;;
DerivedData)
# Protect Xcode global DerivedData in ~/Library/Developer/Xcode/
# Only allow purging DerivedData within project directories
[[ "$path" == *"/Library/Developer/Xcode/DerivedData"* ]] && return 0
return 1
;;
esac
return 1