-
Notifications
You must be signed in to change notification settings - Fork 21
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 dot_to_package fn like rprojroot #305
Conversation
@cboettig You're like going to have to opine here somewhere, because this PR attempts to make functionality less strictly dependent on exact all(c("DESCRIPTION", "NAMESPACE", "man", "R") %in% dir(path)) # where `path` is passed as `pkg` That's clearly only looking for source directories, and is not overloaded. So to the extent that it is not, I would suggest you might be best off first merging this PR, then getting @ThierryO to extend PR #303 to ensure that the |
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.
Thanks a ton @mpadge! This sounds like an useful feature.
Can you make the PR to dev?
# dot_to_package: convert pkg = "." to proper package path ------------------ | ||
dot_to_package <- function(pkg = ".") { | ||
|
||
# https://github.com/r-lib/rprojroot/blob/master/R/root.R#L115: |
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.
Could you please add rprojroot as a dependency? We'd still be under 20 Imports.
This enables
write_codemetar
to be called from anywhere within a package directory structure. It is essentially a hard-coded version of whatrprojroot
does to locate the root of an R package. Pretty sure it has no effects on anything else, as it's only evoked whenpkg = "."
.That's annoying because it does exist! With this PR:
Created on 2021-02-16 by the reprex package (v1.0.0)
That's better!