Skip to main content

Module update

Module update 

Source
Expand description

Self-update version check functionality.

This module provides functionality to check for newer versions of dcg by querying the GitHub Releases API. Results are cached to avoid API spam.

Structs§

BackupEntry
Backup entry metadata stored alongside the backup binary.
VersionCheckResult
Result of a version check operation.

Enums§

VersionCheckError
Errors that can occur during version check or update.

Constants§

CACHE_DURATION
Cache duration for version checks (24 hours).

Functions§

backup_dir
Get the path to the backup directory.
check_for_update
Check for updates, using cache if available.
clear_cache
Clear the version check cache.
create_backup
Create a backup of the current dcg binary before updating.
current_version
Get the current version of dcg from Cargo.toml.
format_backup_list
Format backup list for display.
format_check_result
Format the version check result for display.
format_check_result_json
Format version check result as JSON.
get_update_notice
Get an update notice from the cache without blocking.
is_update_check_enabled
Check if update checking is enabled via environment variable.
list_backups
List all available backup versions, sorted by creation time (newest first).
read_cached_check
Read a cached version check result if it is still fresh.
rollback
Rollback to a previous version.
spawn_background_check
Spawn a background thread to check for updates.
spawn_update_check_if_needed
Spawn a background update check to refresh the cache if needed.