Skip to content

wdx update

Show whether a newer wdx is released, install it or roll it back.

Terminal window
wdx update [--apply | --rollback] [flags]

Without a flag nothing changes. --apply installs the newest release on the channel (the update.channel setting, or --channel); the daemon is stopped, the installed binary, a backup of the database and the config file are kept, and the daemon starts on the new binary. If any step fails, they are put back and the daemon starts on the old binary.

The release writes the config file anew, as its settings write does: the values set stay, its new settings are listed, and keys it no longer has are commented out at the end.

--rollback installs the kept version again, with the config file as it was before the update. The database stays when that version can use it; when a migration since the update breaks it, the backup is restored, losing every change since the update, which --discard-changes or the prompt agrees to, and --cancel refuses. Only one previous version is kept.

Flag Default Description
--apply install the newest release on the channel
--cancel with --rollback, change nothing without asking when the previous version needs the database backup restored
--channel <channel> stable follow this channel: stable or dev; the update.channel setting by default
--discard-changes with --rollback, restore the database backup without asking when the previous version needs it
--rollback install the version the last update replaced
--version <version> this release version instead of the newest, such as 0.2.0
  • at most one of --apply or --rollback
  • at most one of --discard-changes or --cancel
  • at most one of --rollback or --channel
  • at most one of --rollback or --version
  • with --json and --rollback: one of --discard-changes or --cancel
Terminal window
# Show whether a newer release is available
wdx update
# Install it
wdx update --apply
# Install the newest dev release this once
wdx update --apply --channel dev
# Install one release
wdx update --apply --version 0.2.0
# Go back to the version the last update replaced
wdx update --rollback
# From a script, restoring the database backup if the previous version needs it
wdx update --rollback --discard-changes --json
# From a script, rolling back only if the database can stay
wdx update --rollback --cancel --json

Without a flag, the installed version, the newest on the channel and whether it is newer; with --apply or --rollback, the versions and schema versions before and after. With --json: {“update”: {“current”: …, “latest”: …, “channel”: …, “available”: …}}, or {“result”: …, “update”: {“from”: …, “to”: …, “channel”: …, “schema_from”: …, “schema_to”: …, “data_restored”: …, “settings”: {“added”: […], “dropped”: […]}}, “warnings”: […]}

With --json, result is one of: rolled_back, up_to_date or updated.

Code Exit When
checksum_mismatch 3 the downloaded release does not match its checksum
download_failed 3 the release could not be found or downloaded
no_previous_version 1 no previous version is kept to roll back to
older_version 1 the release is older than the installed version
restore_required 1 rolling back needs the database backup, losing the changes since the update
settings_invalid 1 the release does not accept a value the config file sets
update_failed 3 the update or rollback failed and was undone
update_running 1 another update or rollback is running
usage 2 the request, command line or a setting is invalid
internal 3 an unexpected failure: database, filesystem or git