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

feat: ability to hook into cap commands #3593

Closed
buschtoens opened this issue Sep 22, 2020 · 3 comments · Fixed by #4739
Closed

feat: ability to hook into cap commands #3593

buschtoens opened this issue Sep 22, 2020 · 3 comments · Fixed by #4739

Comments

@buschtoens
Copy link
Contributor

buschtoens commented Sep 22, 2020

Feature Request

Description

Enable users to hook into any cap command to run before and after hooks. This is useful, e.g. to allow users to run custom scripts when running cap sync.

Preferred Solution

.ts file

Allow users to add a .ts file in the project root that contains hooks.

capacitor.config.ts

As the capacitor.config.json will be generated on-the-fly in Capacitor 3, we could also export the hooks here to avoid adding another file.

package.json scripts

Check the scripts defined in the package.json. Scripts named cap:${command}:(before|after) are executed, e.g. cap:copy:before.

@EinfachHans
Copy link
Contributor

As long as my PR #4536 isn't merged this would be awesome for me, otherwise i can't use AppFlow 😕

@EinfachHans
Copy link
Contributor

I created a PR: #4739

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants