Skip to content

Commit

Permalink
Merge pull request #21 from lursk/master
Browse files Browse the repository at this point in the history
Added env variable with custom location of .netrc file
  • Loading branch information
eyalbe4 authored Nov 14, 2018
2 parents a0a3833 + 975fe51 commit 8073204
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pod repo-art add artifactory-local http://art-prod.company.com:8081/artifactory/
To use 'myRepo' to resolve pods when installing you must add the following to your Podfile:
```ruby
plugin 'cocoapods-art', :sources => [
'<local_specs_repo_name>'
]
'<local_specs_repo_name>'
]
```
More than one source can be included, separated by commas.

Expand All @@ -28,6 +28,11 @@ password password
```
You can also use an encrypted Artifactory password or your API key

If your .netrc file is not located in your home directory, you can specify its location in the environmental variable:
```
export COCOAPODS_ART_NETRC_PATH=$HOME/myproject/.netrc
```

## Artifactory Configuration
See the [Artifactory User Guide](https://www.jfrog.com/confluence/display/RTF/CocoaPods+Repositories)

Expand Down
7 changes: 6 additions & 1 deletion lib/cocoapods_plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ def self.options
alias_method :orig_should_flatten?, :should_flatten?

def download_file(full_filename)
curl! '-f', '-L', '-o', full_filename, url, '--create-dirs', '--netrc-optional'
curl_options = ["-f", "-L", "-o", full_filename, url, "--create-dirs", "--netrc-optional"]

netrc_path = ENV["COCOAPODS_ART_NETRC_PATH"]
curl_options.concat(["--netrc-file", Pathname.new(netrc_path).expand_path]) if netrc_path

curl! curl_options
end

# Note that we disabled flattening here for the ENTIRE client to deal with
Expand Down

0 comments on commit 8073204

Please sign in to comment.