Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix #58: Check custom action usage inside other custom actions by using a queue #61

Merged
merged 3 commits into from
Jun 2, 2024

Conversation

NoelTautges
Copy link
Contributor

This PR fixes bug #58 by using a queue to check custom action usage.

Beginning with the main body of the Shortcut, custom action uses are detected and added to the queue. The function continuously cycles through the queue, adding newly used custom actions, until all possible matches are exhausted.

Notes:

  • It makes sure the action isn't already marked as used because otherwise recursive functions go haywire.
  • It adds a dummy custom action to make the loop that goes through the queue more clean. This is... questionable, but it does work.
  • Ignore the PR behind the curtain (Check custom action usage inside other custom actions by using a queue #59), I accidentally closed it after syncing my fork with the upstream repository.

Each action used is checked for new custom action uses. This makes it so custom actions that are only referenced within other custom actions are marked as used and included in the final program.
@NoelTautges NoelTautges changed the title Check custom action usage inside other custom actions by using a queue bugfix #58: Check custom action usage inside other custom actions by using a queue May 30, 2024
custom_actions.go Outdated Show resolved Hide resolved
@electrikmilk electrikmilk merged commit a6fd295 into electrikmilk:main Jun 2, 2024
3 checks passed
@electrikmilk
Copy link
Owner

Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom actions aren't detected as used when only used inside other custom actions
2 participants