Skip to content

Commit 6196faa

Browse files
committed
avoid error when testing for membership in a nonexistent directory
1 parent 1f41448 commit 6196faa

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2121

2222
### Fixed
2323
- Don't define `ostream& operator<<(nullptr_t)` if already defined by Apple
24+
- `CppLibrary.in_tests_dir?` no longer produces an error if there is no tests directory
2425

2526
### Security
2627

Diff for: lib/arduino_ci/cpp_library.rb

+2
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ def vendor_bundle?(path)
122122
# @param path [Pathname] The path to check
123123
# @return [bool]
124124
def in_tests_dir?(path)
125+
return false unless tests_dir.exist?
126+
125127
tests_dir_aliases = [tests_dir, tests_dir.realpath]
126128
# we could do this but some rubies don't return an enumerator for ascend
127129
# path.ascend.any? { |part| tests_dir_aliases.include?(part) }

0 commit comments

Comments
 (0)