Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when running on mounted filesystems #9200

Merged
merged 1 commit into from Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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