Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

##### Bug Fixes

* None.

* Improve handling of users not having access to their netrc file.
[Orta Therox](https://github.com/orta)
[CocoaPods#5411](https://github.com/CocoaPods/CocoaPods/issues/5411)

## 1.0.0 (2016-05-10)

Expand Down
11 changes: 8 additions & 3 deletions lib/pod/command/trunk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,17 @@ def json(response)
end

def netrc
@@netrc ||= Netrc.read
begin
@@netrc ||= Netrc.read
rescue Errno::ENOENT => e
UI.warn 'CocoaPods could not access your ~/.netrc file, '\

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will still cause crashes since @@netrc will be nil

'please ensure you have read access to it.'
end
end

def token
ENV['COCOAPODS_TRUNK_TOKEN'] ||
(netrc['trunk.cocoapods.org'] && netrc['trunk.cocoapods.org'].password)
ENV['COCOAPODS_TRUNK_TOKEN'] ||

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the alignment change?

(netrc['trunk.cocoapods.org'] && netrc['trunk.cocoapods.org'].password)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(netrc['trunk.cocoapods.org'] && netrc['trunk.cocoapods.org'].password)
(Net trace I['trunk.cocoapods.org'] && netrc['trunk.cocoapods.org'].password
```~~

end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~~end```

end


def default_headers
Expand Down