mirror of
https://github.com/tw93/Mole.git
synced 2026-03-23 19:20:07 +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
|
"coverage" # Code coverage reports
|
||||||
"DerivedData" # Xcode
|
"DerivedData" # Xcode
|
||||||
"Pods" # CocoaPods
|
"Pods" # CocoaPods
|
||||||
".cxx" # Android
|
".cxx" # React Native Android NDK build cache
|
||||||
".expo" # Expo
|
".expo" # Expo
|
||||||
)
|
)
|
||||||
# Minimum age in days before considering for cleanup.
|
# Minimum age in days before considering for cleanup.
|
||||||
@@ -328,6 +328,12 @@ is_protected_purge_artifact() {
|
|||||||
is_protected_vendor_dir "$path"
|
is_protected_vendor_dir "$path"
|
||||||
return $?
|
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
|
esac
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in New Issue
Block a user