diff --git a/CHANGELOG.md b/CHANGELOG.md
index 59152c9..d3802b0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
-git stat
+## [v1.2.0] (2017-10-20)
+
+### Feature
+* Notify if alfred-workflow detects a new version of alfred-gitlab
+
+### Fixed
+* Refresh after background updating of GitLab projects list
+
+## [v1.1.0] (2017-10-20)
+* Enable background updating of GitLab projects list
## [v1.0.2] (2017-10-20)
* Bump alfred-workflow to 1.28.1 to fix issues
@@ -17,8 +26,9 @@ git stat
* Initial implementaiton of alfred-gitlab workflow
-[Unreleased]: https://github.com/lukewaite/alfred-gitlab/compare/v1.1.0...HEAD
-[v1.1.2]: https://github.com/lukewaite/alfred-gitlab/compare/v1.0.2...v1.1.0
+[Unreleased]: https://github.com/lukewaite/alfred-gitlab/compare/v1.2.0...HEAD
+[v1.2.0]: https://github.com/lukewaite/alfred-gitlab/compare/v1.1.0...v1.2.0
+[v1.1.0]: https://github.com/lukewaite/alfred-gitlab/compare/v1.0.2...v1.1.0
[v1.0.2]: https://github.com/lukewaite/alfred-gitlab/compare/v1.0.1...v1.0.2
[v1.0.1]: https://github.com/lukewaite/alfred-gitlab/compare/v1.0.0...v1.0.1
[v1.0.0]: https://github.com/lukewaite/alfred-gitlab/compare/90b63639ac1d06f9a52c37afd3f9c1da37d6ebd2...v1.0.0
diff --git a/GitLab-1.1.0.alfredworkflow b/GitLab-1.2.0.alfredworkflow
similarity index 97%
rename from GitLab-1.1.0.alfredworkflow
rename to GitLab-1.2.0.alfredworkflow
index 6a8a112..b9ce5b6 100644
Binary files a/GitLab-1.1.0.alfredworkflow and b/GitLab-1.2.0.alfredworkflow differ
diff --git a/src/gitlab.py b/src/gitlab.py
index fe076e0..ae25cc3 100644
--- a/src/gitlab.py
+++ b/src/gitlab.py
@@ -1,10 +1,10 @@
# encoding: utf-8
import sys
import argparse
-from workflow import Workflow, ICON_WEB, ICON_WARNING, ICON_INFO, web, PasswordNotFound
+from workflow import Workflow3, ICON_WEB, ICON_WARNING, ICON_INFO, web, PasswordNotFound
from workflow.background import run_in_background, is_running
-__version__ = '1.1.0'
+__version__ = '1.2.0'
log = None
@@ -77,14 +77,22 @@ def main(wf):
projects = wf.cached_data('projects', None, max_age=0)
+ if wf.update_available:
+ # Add a notification to top of Script Filter results
+ wf.add_item('New version available',
+ 'Action this item to install the update',
+ autocomplete='workflow:update',
+ icon=ICON_INFO)
+
# Start update script if cached data is too old (or doesn't exist)
- if not wf.cached_data_fresh('projects', max_age=600):
+ if not wf.cached_data_fresh('projects', max_age=3600):
cmd = ['/usr/bin/python', wf.workflowfile('update.py')]
run_in_background('update', cmd)
# Notify the user if the cache is being updated
if is_running('update'):
- wf.add_item('Updating project list via GitLab',
+ wf.rerun = 1
+ wf.add_item('Updating project list via GitLab...',
valid=False,
icon=ICON_INFO)
@@ -104,13 +112,17 @@ def main(wf):
subtitle=project['path_with_namespace'],
arg=project['web_url'],
valid=True,
- icon=ICON_WEB)
+ icon=None)
# Send the results to Alfred as XML
wf.send_feedback()
if __name__ == u"__main__":
- wf = Workflow()
+ wf = Workflow3(update_settings={
+ 'github_slug': 'lukewaite/alfred-gitlab',
+ 'version': __version__,
+ 'frequency': 1
+ })
log = wf.logger
sys.exit(wf.run(main))
\ No newline at end of file
diff --git a/src/info.plist b/src/info.plist
index c0c5984..4597720 100644
--- a/src/info.plist
+++ b/src/info.plist
@@ -346,7 +346,7 @@
version
- 1.1.0
+ 1.2.0
webaddress
https://lukewaite.ca