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

reload(".") does not load "." #1848

Closed
heavywatal opened this issue Aug 17, 2018 · 2 comments
Closed

reload(".") does not load "." #1848

heavywatal opened this issue Aug 17, 2018 · 2 comments

Comments

@heavywatal
Copy link
Contributor

The behavior of reload(".") is a little surprising to me. After unloading ".", it tries to load a package with the same name from somewhere in.libPaths(). It applies to any case where a path is passed as pkg argument. I guess many users expect the package in the given path is loaded by this function even if they know load_all() is a more preferable way to reload a package under development.

devtools/R/reload.r

Lines 25 to 33 in 5bbcac4

reload <- function(pkg = ".", quiet = FALSE) {
pkg <- as.package(pkg)
if (is_attached(pkg)) {
if (!quiet) message("Reloading installed ", pkg$package)
pkgload::unload(pkg$package)
require(pkg$package, character.only = TRUE, quietly = TRUE)
}
}

@hadley
Copy link
Member

hadley commented Aug 22, 2018

I think this is a documentation problem since reload() is unrelated to load_all().

@lock
Copy link

lock bot commented Apr 14, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Apr 14, 2019
HughParsonage pushed a commit to HughParsonage/devtools that referenced this issue Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants