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

Question about commented-out code #26

Open
wleoncio opened this issue Sep 7, 2021 · 0 comments
Open

Question about commented-out code #26

wleoncio opened this issue Sep 7, 2021 · 0 comments

Comments

@wleoncio
Copy link
Contributor

wleoncio commented Sep 7, 2021

I was curious about why part of the code below is commented out:

badger/R/badge.R

Lines 56 to 77 in 01b6f5a

ver_devel <- function (pkg = NULL) {
## flag <- FALSE
## if (file.exists("DESCRIPTION")) {
## x <- readLines("DESCRIPTION")
## flag <- TRUE
## } else if (file.exists("../DESCRIPTION")) {
## x <- readLines("../DESCRIPTION")
## flag <- TRUE
## }
## if (flag) {
## y <- x[grep("^Version", x)]
## v <- sub("Version: ", "", y)
## if ((as.numeric(gsub("\\d+\\.(\\d+)\\.\\d+", "\\1", v))%%2) == 1) {
## return(v)
## }
## }
pkg <- currentGitHubRef(pkg)
ver <- tryCatch(desc::desc_get_field("Version"), error = function(e) NULL)
if (is.null(ver ))
ver <- check_github(pkg)$latest_version
return(ver)
}

It looks like an attempt to read the package version from a local DESCRIPTION, which sounds to me like a useful feature (instead of having the function always try to retrieve it from GitHub).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant