Checks if a newer version of Quarto is available and informs the user about their current version status. The function compares the current Quarto version against the latest stable and prerelease versions available online.
Usage
check_newer_version(version = quarto_version(), verbose = TRUE)
Arguments
- version
Character string specifying the Quarto version to check. Defaults to the currently installed version detected by
quarto_version()
. Use "99.9.9" to indicate a development version.- verbose
Logical indicating whether to print informational messages. Defaults to
TRUE
. WhenFALSE
, the function runs silently and only returns the logical result.
Value
Invisibly returns a logical value:
TRUE
if an update is availableFALSE
if no update is needed or when using development version The function is primarily called for its side effects of printing informational messages (whenverbose = TRUE
).
Details
The function handles three scenarios:
Development version (99.9.9): Skips version check with informational message
Prerelease version: Compares against latest prerelease and informs about updates
Stable version: Compares against latest stable version and suggests updates if needed
Version information is fetched from Quarto's download JSON endpoints and cached in current session for up to 24 hours to avoid repeated network requests.
Network Requirements
This function requires an internet connection to fetch the latest version information from quarto.org. If the network request fails, an error will be thrown.
See also
quarto_version()
for getting the current Quarto version,
Examples
# Check current Quarto version
check_newer_version()
#> ℹ You are using prerelease version of Quarto: 1.8.14.
#> You are using the latest prerelease version.
# Check a specific version
check_newer_version("1.7.30")
#> ℹ You are using an older version of Quarto: 1.7.30.
#> The latest stable version is: 1.7.32.
#> → You can download new version from https://quarto.org/docs/download/ or your
#> preferred package manager if available.
# Check development version (will skip check)
check_newer_version("99.9.9")
#> ℹ Skipping version check for development version.
#> → Please update using development mode.
# Check silently without messages
result <- check_newer_version(verbose = FALSE)
if (result) {
message("Update available!")
}