Skip to content

Commit 4491bd2

Browse files
committed
Release-ready update handling
1 parent 191e6fa commit 4491bd2

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

src/so.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
UPDATE_SETTINGS = {'github_slug': 'deanishe/alfred-stackoverflow'}
2727

2828
ICON_ANSWERED = 'answered.png'
29+
ICON_UPDATE = 'update-available.png'
2930

3031
# Shown in error logs. Users can find help here
3132
HELP_URL = 'https://github.com/deanishe/alfred-stackoverflow'
@@ -109,6 +110,14 @@ def get_answers(query=None, tags=None, limit=RESULT_COUNT):
109110

110111

111112
def main(wf):
113+
114+
# Update available?
115+
if wf.update_available:
116+
wf.add_item('A newer version is available',
117+
'↩ to install update',
118+
autocomplete='workflow:update',
119+
icon=ICON_UPDATE)
120+
112121
query = wf.args[0].strip()
113122

114123
# Tag prefix only. Treat as blank query
@@ -174,7 +183,6 @@ def main(wf):
174183

175184
if __name__ == '__main__':
176185
wf = Workflow(help_url=HELP_URL,
177-
# update_settings=UPDATE_SETTINGS,
178-
)
186+
update_settings=UPDATE_SETTINGS)
179187
log = wf.logger
180188
sys.exit(wf.run(main))

src/update-available.png

11.2 KB
Loading

src/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9-beta
1+
1.0

0 commit comments

Comments
 (0)