Skip to content

Commit

Permalink
Check for community installation
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasArvidsson committed Nov 21, 2024
1 parent 8cd7c21 commit 49dd7a2
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions cursorless-talon/src/check_community_repo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from talon import app, registry

required_captures = [
"number_small",
"user.any_alphanumeric_key",
"user.formatters",
"user.ordinals_small",
]

required_actions = [
"user.homophones_get",
"user.reformat_text",
]


def onready():
missing_captures = [
capture for capture in required_captures if capture not in registry.captures
]
missing_actions = [
action for action in required_actions if action not in registry.actions
]
errors = []
if missing_captures:
errors.append(f"Missing captures: {', '.join(missing_captures)}")
if missing_actions:
errors.append(f"Missing actions: {', '.join(missing_actions)}")
if errors:
errors.insert(0, "https://github.com/talonhub/community")
message = "\n".join(errors)
app.notify("Cursorless missing community repository", body=message)


app.register("ready", onready)

0 comments on commit 49dd7a2

Please sign in to comment.