Skip to content

Commit

Permalink
remove load check for package version
Browse files Browse the repository at this point in the history
  • Loading branch information
venpopov committed May 28, 2024
1 parent 247e523 commit 475c1a1
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,7 @@

optionsMsg <- tryCatch2(bmm_options())$message

if (interactive() && !isFALSE(as.logical(Sys.getenv("BMM_CHECK_CRAN_VERSION")))) {
# test if local installation is behind CRAN
cran_pkgs <- utils::available.packages(repos = "http://cran.us.r-project.org")
cran_version <- cran_pkgs[which(cran_pkgs[, "Package"] == "bmm"), "Version"]
behind_cran <- cran_version > local_version

if (length(behind_cran) > 0 && behind_cran) {
msg <- "A newer version of bmm is available on CRAN."
packageStartupMessage(msg, "\nWould you like to install it?")
if (utils::menu(c("Yes", "No")) == 1) {
utils::update.packages("bmm")
}
} else {
packageStartupMessage(banner, versionMsg, startUpMsg, optionsMsg)
}
if (interactive()) {
packageStartupMessage(banner, versionMsg, startUpMsg, optionsMsg)
}
}

0 comments on commit 475c1a1

Please sign in to comment.