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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user