r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
336 stars 153 forks source link

install_github() generates incorrect URL for release tarball #594

Closed dholstius closed 3 years ago

dholstius commented 3 years ago

Minimal reprex:

> install_github("r-lib/vctrs", ref = "0.3.6")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo r-lib/vctrs@0.3.6
Error in utils::download.file(url, path, method = method, quiet = quiet,  : 
  cannot open URL 'https://api.github.com/repos/r-lib/vctrs/tarball/0.3.6'

The correct URL in this case is https://github.com/r-lib/vctrs/archive/v0.3.6.tar.gz .

jimhester commented 3 years ago

ref is the name of the git branch or tag. e.g. vctrs is using v0.3.6 (with the prepending v) as the name of the tag, so you would need to use remotes::install_github("r-lib/vctrs@v0.3.6")

dholstius commented 3 years ago

Oops! Please ignore my PR then. Mea culpa!