File tree Expand file tree Collapse file tree 4 files changed +30
-1
lines changed
Expand file tree Collapse file tree 4 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
88
99### Added
1010
11+ * Support glob patterns in sentinel definitions, enabling wildcards like ` *.xcodeproj ` ([ stevegrunwell/asimov #64 ] , props @mdab121 )
12+ * Exclude Xcode DerivedData when ` *.xcodeproj ` is present ([ stevegrunwell/asimov #64 ] , props @mdab121 )
1113* Exclude Next.js build cache (` .next ` )
1214* Exclude Nuxt build cache (` .nuxt ` )
1315* Exclude Angular CLI cache (` .angular ` )
@@ -117,3 +119,4 @@ Initial public release.
117119[ #55 ] : https://github.com/stevegrunwell/asimov/pull/55
118120[ #35 ] : https://github.com/stevegrunwell/asimov/pull/35
119121[ #56 ] : https://github.com/stevegrunwell/asimov/pull/56
122+ [ stevegrunwell/asimov#64 ] : https://github.com/stevegrunwell/asimov/pull/64
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ readonly ASIMOV_VENDOR_DIR_SENTINELS=(
4949 ' .venv pyproject.toml' # virtualenv (Python)
5050 ' Carthage Cartfile' # Carthage
5151 ' Pods Podfile' # CocoaPods
52+ ' DerivedData *.xcodeproj' # Xcode DerivedData
5253 ' bower_components bower.json' # Bower (JavaScript)
5354 ' build build.gradle' # Gradle
5455 ' build build.gradle.kts' # Gradle Kotlin Script
@@ -130,10 +131,20 @@ for i in "${ASIMOV_VENDOR_DIR_SENTINELS[@]}"; do
130131 #
131132 # For example, when looking at a /vendor directory, we may choose to
132133 # ensure a composer.json file is available.
134+ #
135+ # Sentinels containing wildcards (e.g. *.xcodeproj) use glob expansion
136+ # via sh -c instead of a plain `test -e`.
137+ # Glob support inspired by stevegrunwell/asimov#64 (props @mdab121).
138+ if [[ " $_sibling_sentinel_name " == * ' *' * ]]; then
139+ _sentinel_check=( -execdir sh -c ' ls -d ' " ${_sibling_sentinel_name} " ' >/dev/null 2>&1' \; )
140+ else
141+ _sentinel_check=( -execdir test -e " ${_sibling_sentinel_name} " \; )
142+ fi
143+
133144 find_parameters_vendor+=( -or \( \
134145 -type d \
135146 -name " ${_exclude_name} " \
136- -execdir test -e " ${_sibling_sentinel_name} " \; \
147+ " ${_sentinel_check[@]} " \
137148 -prune \
138149 -print \
139150 \) )
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ load test_helper
3636 [[ " $( count_exclusions) " -eq 0 ]]
3737}
3838
39+ @test " does not exclude DerivedData without *.xcodeproj" {
40+ mkdir -p " ${HOME} /Code/My-Project/DerivedData"
41+ run_asimov
42+ refute_excluded " ${HOME} /Code/My-Project/DerivedData"
43+ [[ " $( count_exclusions) " -eq 0 ]]
44+ }
45+
3946# =============================================================================
4047# Multi-match and deduplication
4148# =============================================================================
Original file line number Diff line number Diff line change @@ -165,6 +165,14 @@ load test_helper
165165 [[ " $( count_exclusions) " -eq 1 ]]
166166}
167167
168+ @test " Xcode: excludes DerivedData when *.xcodeproj is present" {
169+ mkdir -p " ${HOME} /Code/My-Project/DerivedData"
170+ mkdir -p " ${HOME} /Code/My-Project/MyApp.xcodeproj"
171+ run_asimov
172+ assert_excluded " ${HOME} /Code/My-Project/DerivedData"
173+ [[ " $( count_exclusions) " -eq 1 ]]
174+ }
175+
168176# --- JavaScript ---
169177
170178@test " Bower: excludes bower_components when bower.json is present" {
You can’t perform that action at this time.
0 commit comments