Skip to content

Commit

Permalink
Merge pull request #90 from dbetebenner/master
Browse files Browse the repository at this point in the history
Update of startup message
  • Loading branch information
dbetebenner authored Dec 9, 2024
2 parents e798695 + 98cd1a7 commit e910eac
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ function(libname, pkgname) {
lines <- readLines(url, warn = FALSE)
version_line <- grep("^Version:", lines, value = TRUE)
if (length(version_line) > 0) {
return(strsplit(version_line, ": ")[[1]][2])
return(cyan("v", strsplit(version_line, ": ")[[1]][2], sep=""))
} else {
return("Unavailable")
return(red("Not Available"))
}
}, error = function(e) {
return("Unavailable")
return(red("Not Available"))
}, warning = function(w) {
return("Unavailable")
return(red("Not Available"))
})
}

# Extract version information
installed.version <- utils::packageDescription("randomNames")[['Version']]
cran.version <- tryCatch(
pkgsearch::cran_package("randomNames")[['Version']],
error = function(e) "Unavailable",
warning = function(w) "Unavailable")
green("v", pkgsearch::cran_package("randomNames")[['Version']], sep=""),
error = function(e) red("Not Available"),
warning = function(w) red("Not Available"))
dev.version <- get_dev_version("randomNames")

# Define a friendly startup message
message_text <- paste0(
magenta(bold("\uD83C\uDF89 randomNames v", installed.version, sep="")), " - ", toOrdinal::toOrdinalDate("2024-12-4"), "\n",
strrep("\u2501", 40), "\n",
bold("\U1F4E6 CRAN: "), green("v", cran.version, sep=""), "\n",
bold("\U1F527 Dev: "), cyan("v", dev.version, sep=""), "\n",
bold("\U1F4E6 CRAN: "), cran.version, "\n",
bold("\U1F527 Dev: "), dev.version, "\n",
strrep("\u2501", 40), "\n",
"\U1F4A1 Tip: ", magenta(bold("> help(package=\"randomNames\")")), "\n",
"\U1F310 Docs: ", magenta(bold("https://centerforassessment.github.io/randomNames")), "\n",
Expand Down

0 comments on commit e910eac

Please sign in to comment.