Skip to content

Commit

Permalink
feat(assets_info): Return assets versions as invisible table
Browse files Browse the repository at this point in the history
And use `message()` instead of `cat()` to make it easier to suppress the printed output
  • Loading branch information
gadenbuie committed Jul 1, 2024
1 parent f6099fe commit c90b778
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions R/assets.R
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ assets_info <- function() {
installed_versions <- "(None)"
}

cat(
message(
collapse(c(
paste0("shinylive R package version: ", SHINYLIVE_R_VERSION),
paste0("shinylive web assets version: ", assets_version()),
Expand All @@ -361,7 +361,21 @@ assets_info <- function() {
sep = ""
)

invisible()
versions <- vapply(
strsplit(installed_versions, "shinylive-", fixed = TRUE),
FUN.VALUE = character(1),
function(x) x[[2]]
)

data <- data.frame(
version = versions,
path = installed_versions,
is_assets_version = versions == assets_version()
)

class(data) <- c("tbl_df", "tbl", "data.frame")

invisible(data)
}


Expand Down

0 comments on commit c90b778

Please sign in to comment.