Raxol.System.Updater (Raxol v0.5.0)

View Source

Provides version management and self-update functionality for Raxol.

This module handles:

  • Checking for updates from GitHub releases
  • Comparing versions to determine if updates are available
  • Self-updating the application when running as a compiled binary
  • Managing update settings and configurations

Summary

Functions

cancel_update()

check_for_updates()

check_for_updates(opts \\ [])

Checks if a newer version of Raxol is available.

Returns a tuple with the check result and the latest version if available:

  • {:no_update, current_version} - No update available
  • {:update_available, latest_version} - Update available
  • {:error, reason} - Error occurred during check

Parameters

  • force: When set to true, bypasses the update check interval. Defaults to false.

Examples

iex> Raxol.System.Updater.check_for_updates()
{:no_update, "0.1.0"}

iex> Raxol.System.Updater.check_for_updates(force: true)
{:update_available, "0.2.0"}

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear_update_error()

clear_update_history()

clear_update_log()

clear_update_stats()

do_replace_executable(current_exe, new_exe, platform)

download_update(version)

get_available_versions()

get_current_version()

get_update_error()

get_update_history()

get_update_log()

get_update_progress()

get_update_settings()

get_update_stats()

install_update(context, version)

notify_if_update_available()

Displays update information to the user, if an update is available.

This function checks for updates (respecting the check interval) and outputs a message to the user if an update is available.

Examples

iex> Raxol.System.Updater.notify_if_update_available()
:ok

rollback_update()

self_update(version \\ nil, opts \\ [])

set_auto_check(enabled)

Enables or disables automatic update checks.

Parameters

  • enabled: Whether to enable or disable automatic update checks

Examples

iex> Raxol.System.Updater.set_auto_check(true)
:ok

iex> Raxol.System.Updater.set_auto_check(false)
:ok

set_update_settings(settings)

start_link(opts \\ [])

update(opts \\ [])