#' Fetch information about the local and remote
#' Cloudstan versions.
#'
#' @return Object containing version information.
#'
#' @export
#'
version <- function() {
rsp <- processx::run(
bin_path(),
args = c(
"--json",
"--non-interactive",
"version",
"--remote"
),
spinner = TRUE,
error_on_status = FALSE
)
jsonlite::parse_json(rsp$stdout)$success
}
#' Reports whether the currently installed CLI
#' is the latest version.
#'
#' @return Boolean indicating if CLI version is latest.
#'
#' @export
#'
is_latest_version <- function() {
if(bin_exists()) {
version <- version()
version$version == version$remoteVersion
} else {
FALSE
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.