-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add shim for system.file to work with devtools-loaded packages #129
Conversation
Hmm, I don't see any errors when I run (Update: It wasn't failing because of the workaround I have in my .Rprofile) |
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.
Just cause I'm curious, how does find.package()
know to return the source path and not the installed path?
Line 20 in aad84f5
pkg_path <- find.package(package) |
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.
Maybe we should use pkgload::dev_meta()
if pkgload is installed (to help protect against internal changes to dev_meta()
)
Line 4 in aad84f5
if (is.null(ns) || is.null(ns$.__DEVTOOLS__)) { |
The reason to not use |
R doesn't have a concept of source path vs. installed path; it just has a concept of installed path. So when devtools loads a package, it tells R that the installed path is the source path. |
I was thinking we'd have if (system.file(package = "pkgload") != "") {
return(!is.null(pkgload::dev_meta(package)))
} else if (is.null(ns) || is.null(ns$.__DEVTOOLS__)) {
return(FALSE)
} |
Thanks - I'd still rather not take any sort of dependency on Also, if we do use |
This addresses rstudio/shiny#2468. Now when
devtools::test(, "bootstrap")
is called for shiny, it no longer has errors.