Skip to content

Commit

Permalink
Merge pull request #9200 from CocoaPods/pb-mounted
Browse files Browse the repository at this point in the history
Fix crash when running on mounted filesystems
  • Loading branch information
dnkoutso committed Sep 27, 2019
2 parents 5088b5d + 1523afa commit b6c655f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### Bug Fixes

* None.
* Fix crash when running on mounted filesystems
[Paul Beusterien](https://github.com/paulb777)
[#9200](https://github.com/CocoaPods/CocoaPods/pull/9200)


## 1.8.1 (2019-09-27)
Expand Down
2 changes: 1 addition & 1 deletion lib/cocoapods/config.rb
Expand Up @@ -307,7 +307,7 @@ def configure_with(values_by_key)
def podfile_path_in_dir(dir)
PODFILE_NAMES.each do |filename|
candidate = dir + filename
if candidate.exist?
if candidate.file?
return candidate
end
end
Expand Down
10 changes: 10 additions & 0 deletions spec/unit/config_spec.rb
Expand Up @@ -136,6 +136,16 @@ module Pod
end
end

it 'should not return the working directory as the installation root if found Podfile is a directory' do
Dir.chdir(temporary_directory) do
path = temporary_directory + 'Podfile'
path.mkpath
Dir.chdir(path) do
@config.installation_root.should == path
end
end
end

it 'returns the parent directory which contains the Podfile if it can be found' do
Dir.chdir(temporary_directory) do
File.open('Podfile', 'w') {}
Expand Down

0 comments on commit b6c655f

Please sign in to comment.