It's a Command Line Tool that you embed in your Workflow. That is it.
Then you call it from your Workflow and it does some magic.
Who wants to go check GitHub or a forum post manually to update your Workflow hmm?
- checks for updates on GitHub in the background
- only checks when necessary (frequency checks)
- opens your GitHub release page if you want
- downloads your latest release, moves it to the Users' download folder, opens the workflow
- notifications of your download come from your Workflow, so it's non-blocking and uses your icon ✌🏼️
Alfred Workflow Updater writes a file called last_checked.plist
in your Workflow cache folder that holds information about the last online check.
When the threshold you specified as a argument (see API) is passed, Alfred Workflow Updater checks online if there's an update available for your Workflow, comparing your current local Workflow version against the online latest version available on GitHub.
If a an update is found, Alfred Workflow Updater drops an update_available.plist
file in your Workflow cache folder. This file contains your latest release info (version, file URL, page URL).
All you have to do is pick up that file and show the update whenever and however you want in your own Alfred Workflow.
Better, a video:
AlfredWorkflowUpdater.mp4
-
Call the Alfred Workflow Updater tool with 2 parameters:
- your GitHub repo, like: "godbout/WooshyWindowToTheForeground"
- the frequency threshold in minutes, like "60"
-
Add an
Environment Variable
calledalfred_workflow_updater_asset_name
that contains the name of your Alfred Workflow file as shown in the GitHub Releases. This is necessary because GitHub now loads assets dynamically and we can't grab the asset name through HTML scrapping.
You can:
- generate an update of your Workflow by adding an item variable to your Alfred Result with the name
AlfredWorkflowUpdater_action
and the valueupdate
- open your Workflow's GitHub release page by adding an item variable to your Alfred Result with the name
AlfredWorkflowUpdater_action
and the valueopen
You do not need to pass any other variables with those Alfred Results. The Alfred Workflow Updater will grab the necessary info from your Workflow's cache folder instead.
The following Workflows are using the Alfred Workflow Updater. Best is to download one of them, open it, and check how it's made (it's simple):