Skip to content

Commit

Permalink
add self-updating support #4
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyc committed Feb 25, 2016
1 parent bd5c5a0 commit 53c91bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@ MIT

[alfred-datetime-format]: https://github.com/mwaterfall/alfred-datetime-format-converter
[moment.js]: http://momentjs.com
[DOWNLOAD LINK]: https://github.com/perfectworks/alfred-workflow-moment/releases/download/v1.1/moment.alfredworkflow
[DOWNLOAD LINK]: https://github.com/perfectworks/alfred-workflow-moment/releases
[arrow]: http://crsmithdev.com/arrow/#tokens
16 changes: 11 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ def main(wf):
elif action == 'delFormat':
moment_format.del_format(wf, args[1:])

if __name__ == '__main__':
wf = Workflow()
wf.data_serializer = 'json'
log = wf.logger
sys.exit(wf.run(main))
wf = Workflow({
'github_slug': 'perfectworks/alfred-workflow-moment',
'frequency': 1
})

if wf.update_available:
wf.start_update()

wf.data_serializer = 'json'
log = wf.logger
sys.exit(wf.run(main))
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.2.0

0 comments on commit 53c91bb

Please sign in to comment.