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 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" command via AwGo's background job API.
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).