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

custom remote types #509

Closed
dseynaev opened this issue Jun 17, 2020 · 1 comment
Closed

custom remote types #509

dseynaev opened this issue Jun 17, 2020 · 1 comment
Labels
feature a feature request or enhancement

Comments

@dseynaev
Copy link

dseynaev commented Jun 17, 2020

Is there a way to implement custom remote types e.g. by implementing an install_*() in a third-party package?

My apologies if this has been asked before or is mentioned somewhere but I couldn't find anything with a quick search.

@jimhester
Copy link
Member

No, there is not currently a way to do this.

In order to support it the internal S3 generic methods would have to be exported.

remotes/R/install-remote.R

Lines 155 to 160 in 7720273

is.remote <- function(x) inherits(x, "remote")
remote_download <- function(x, quiet = FALSE) UseMethod("remote_download")
remote_metadata <- function(x, bundle = NULL, source = NULL, sha = NULL) UseMethod("remote_metadata")
remote_package_name <- function(remote, ...) UseMethod("remote_package_name")
remote_sha <- function(remote, ...) UseMethod("remote_sha")

And the lookup at

remotes/R/deps.R

Lines 499 to 500 in 7720273

fun <- get(paste0(tolower(type), "_remote"),
envir = environment(sys.function()), mode = "function", inherits = FALSE)
would have to change in order to support custom remotes in external packages.

@jimhester jimhester added the feature a feature request or enhancement label Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants