diff --git a/src/drive.py b/src/drive.py index ac5f366..01481af 100644 --- a/src/drive.py +++ b/src/drive.py @@ -11,11 +11,7 @@ def main(_): options = True if wf.args[0][0] == '>' else False if wf.update_available: - # wf.start_update() - wf.add_item( - 'An update is available!', - autocomplete='workflow:update') - return wf.send_feedback() + Drive.add_update() try: user_input = wf.args[0][1::].strip() if options else wf.args[0] diff --git a/src/drive_api.py b/src/drive_api.py index 1884069..cd6e54a 100644 --- a/src/drive_api.py +++ b/src/drive_api.py @@ -3,8 +3,10 @@ from config import CLIENT_ID, CLIENT_SECRET, SCOPE, REDIRECT_URI, FILES_URL, AUTH_URL, TOKEN_URL, TOKEN_URL, CACHE_MAX_AGE import requests from workflow import Workflow, ICON_USER +UPDATE_SETTINGS = {'github_slug' : 'azai91/alfred-drive-workflow'} +HELP_URL = 'https://github.com/azai91/alfred-drive-workflow/issues' -wf = Workflow() +wf = Workflow(update_settings=UPDATE_SETTINGS, help_url=HELP_URL) class Drive: @@ -119,6 +121,13 @@ def show_logout(cls): icon=ICON_USER, valid=True) + @classmethod + def add_update(cls): + wf.add_item( + 'New version available!', + 'Action this item to install the update', + autocomplete='workflow:update') + def add_items(links): # sorted(links, key=lambda link : link['lastViewedByMeDate']) for index, link in enumerate(links): diff --git a/src/version b/src/version index a58941b..ceab6e1 100644 --- a/src/version +++ b/src/version @@ -1 +1 @@ -1.3 \ No newline at end of file +0.1 \ No newline at end of file