update

command
v0.29.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Workflow update is an example of how to use AwGo's update API.

It demonstrates best practices for handling updates, in particular loading the list of available releases in a background process and only showing an "Update is available!" message if the user query is empty.

Details

Its own version (set in info.plist via Alfred's UI) is 0.2 and it's pointing to the GitHub repo "deanishe/alfred-ssh" (a completely different workflow), which is several versions ahead.

The Script Filter code loads the time of the last update check, and if a check is due, it calls itself with the "-check" flag via AwGo's background job API.

Because the release updater runs in a background process, its output is not shown in Alfred's debugger. Enter the query "workflow:log" to open the log file if you would like to see the output of the updater.

When run with "-check", the program calls Workflow.CheckForUpdate() to cache the available releases.

After that has completed, subsequent runs of the Script Filter will show an "Update available!" item (if the query is empty).

Actioning (hitting ↩ or ⌘+1) or completing the item (hitting ⇥) auto-completes the query to "workflow:update", which is the keyword for one of AwGo's "magic" actions.

At this point, AwGo will take control of execution, and download and install the newer version of the workflow (but as it's pointing to a different workflow's repo, Alfred will install a different workflow rather than actually updating this one).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL