Skip to content

Commit

Permalink
Add error-handling to Set Pref and Clear Cache actions
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb531 committed Apr 6, 2024
1 parent 3afaf18 commit fb9c8f7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Binary file modified YouVersion Suggest (Alfred 5).alfredworkflow
Binary file not shown.
3 changes: 3 additions & 0 deletions yvs/clear_cache.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/usr/bin/env python3
# coding=utf-8

import json

import yvs.cache as cache


def main():

cache.clear_cache()
print(json.dumps({"alfredworkflow": {"variables": {"did_clear_cache": "True"}}}))


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion yvs/set_pref.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def main(variables):
# value_id needs to be parsed as JSON so we can preserve type data for
# proper serialization to the preferences file
set_pref(variables["pref_id"], json.loads(variables["value_id"]))
print(json.dumps({"alfredworkflow": {"variables": variables}}))
print(json.dumps({"alfredworkflow": {"variables": {"did_set_pref": "True"}}}))


if __name__ == "__main__":
Expand Down

0 comments on commit fb9c8f7

Please sign in to comment.