-
Notifications
You must be signed in to change notification settings - Fork 152
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
Change default download method if needed #46
Conversation
Current coverage is 93.90% (diff: 100%)@@ master #46 diff @@
==========================================
Files 23 23
Lines 1030 1034 +4
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 967 971 +4
Misses 63 63
Partials 0 0
|
} | ||
|
||
"auto" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove the return()
calls, and put in an else
for the "auto"
?
THanks! Left a small comment, otherwise it looks good. |
Done. Just a precision : If "libcurl" is not available on non windows platform, method is set to "auto". Now, not sure what I should do. If you have some advices... I look forward to collaborate more to learn more on the way to go with PR and projects collaborations |
Thanks, and sorry for the delay! You don't need to squash, GH can squash-and-merge now. Thanks again! |
Hello, I just noticed that I did not modified So, just for you to know, PR is merged and it is working now on windows but source("https://raw.githubusercontent.com/MangoTheCat/remotes/master/install-github.R")$value("mangothecat/remotes") is not working without proxy configuration on windows as it has not been updated with the new version of |
Good point. I'll update the script, and the I should probably decide if I want source("https://raw.githubusercontent.com/MangoTheCat/remotes/master/install-github.R")$value("mangothecat/remotes") or source("https://install-github.me/mangothecat/remotes") |
I updated the script and the script and the service as well. Can you please try that both commands in the previous comment work? Thanks! |
I tried and it is working now - both method. I would have done it but I was not sure if your |
No worries, it is updated like this:
or the equivalent code from R, with the working directory set to the project root. And you cannot update the service, because of permissions. |
OK. good to know how it is working, I was wondering ! Thanks ! |
So, just a note, that I'll change the default method to libcurl, whenever it is available, because it is not possible to send custom headers, and thus do a basic HTTP auth, with wininet. You'll be still able to use wininet, if you set
|
The default download method now respects the `download.file.method` user option, if set. Otherwise, if libcurl is supported, it will be selected. (Before, wininet was preferred on Windows, because it sets the proxies automatically, see #46.)
The default download method now respects the `download.file.method` user option, if set. Otherwise, if libcurl is supported, it will be selected. (Before, wininet was preferred on Windows, because it sets the proxies automatically, see #46.)
Thank you for the change notice @gaborcsardi ! I appreciate it. |
This PR follows a discussion to resolve #45 . See issue post.
Based on some research about downloads method in R, I decided to modify
download_method
function in the following wayComparing with the previous function, I just reversed the checking (Windows before libcurl) and I rely on default R for newer than 3.3
I noticed that for R older than 3.2.0,
curl_download
is used anddowload_method
is not called. So I did not take care of this case.If libcurl is not available on non windows O, we rely on default method
I have modified the test to be compliant with the new function, and I have added some infos in Readme about download methods to point users toward
download.file
function help file.I did not change
intall-github.R
file as it seems you generated it by brew.I did not add a bullet point in NEWS.md as it seems you have not done it before yet.
We could have done differently
downloader
packagebase_download
andcurl_download
and deal with all that indownload
function as it is done indownloader
functionHope it is not too bad and I did not forgot anything
Tell me if something is not clear in what I have done