Skip to content

Commit

Permalink
Check for community installation (#2692)
Browse files Browse the repository at this point in the history
Related ##1953

## Checklist

- [/] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [/] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [/] I have not broken the cheatsheet

---------

Co-authored-by: Pokey Rule <[email protected]>
  • Loading branch information
AndreasArvidsson and pokey authored Dec 12, 2024
1 parent bd2cdd3 commit 1cdf5a3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/check_community_repo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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 on_ready():
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:
print("\n".join(errors))
app.notify(
"Please install the community repository",
body="https://github.com/talonhub/community",
)


app.register("ready", on_ready)

0 comments on commit 1cdf5a3

Please sign in to comment.