-
-
Notifications
You must be signed in to change notification settings - Fork 9
remove system file inst #82
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
Conversation
R/utils.R
Outdated
| inst_file <- file.path(system.file(package = pkg), file_name) | ||
|
|
||
| if (file.exists(base_file)) { | ||
| return(base_file) | ||
| } else if (file.exists(inst_file)) { | ||
| } else if (file.exists()) { | ||
| return(inst_file) | ||
| } else { |
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.
@gogonzo do we actually need inst_file? Or should I remove lines 79 + 83 + 84 ?
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.
agree, remove them as in the compiled package there is no inst directory.
Code Coverage SummaryResults for commit: e9a974b Minimum allowed coverage is ♻️ This comment has been updated with latest results |
|
The base::system.file is overwritten (e.g. when devtools::load_all is used) by the pkgdown version: There are at least two solutions:
|
R/utils.R
Outdated
| checkmate::assert_string(file_name) | ||
| base_file <- system.file(file_name, package = pkg) | ||
| inst_file <- system.file("inst", file_name, package = pkg) | ||
| inst_file <- file.path(system.file(package = pkg), file_name) |
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.
| inst_file <- file.path(system.file(package = pkg), file_name) |
| get_package_file <- function(pkg = NULL, file_name = NULL) { | ||
| checkmate::assert_string(pkg) | ||
| checkmate::assert_string(file_name) | ||
| base_file <- system.file(file_name, package = pkg) |
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.
| base_file <- system.file(file_name, package = pkg) | |
| base_file <- base::system.file(file_name, package = pkg) |
Closes #81
This function is only used in
.onLoadFYI @arkadiuszbeer