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

Preventing actions for specific commands #13

Closed
gvwilson opened this issue Mar 2, 2022 · 6 comments
Closed

Preventing actions for specific commands #13

gvwilson opened this issue Mar 2, 2022 · 6 comments

Comments

@gvwilson
Copy link
Contributor

gvwilson commented Mar 2, 2022

I have a event handler registered for ivy.events.Event.EXIT that copies figure files from src/*/whatever to docs/*/whatever. I want it to run for ivy build and ivy watch, but not for ivy clear. What's the right way to ensure this?

@dmulholl
Copy link
Owner

dmulholl commented Mar 3, 2022

Probably best to register it on the EXIT_BUILD event:

https://github.com/dmulholl/ivy/blob/64ab5c1dbc58c5cacefa365a07ce06ff7ddfbb2f/ivy/cli/build.py#L56

@gvwilson
Copy link
Contributor Author

gvwilson commented Mar 3, 2022

👍 I'll give it a try.

@dmulholl
Copy link
Owner

dmulholl commented Mar 3, 2022

Good stuff. The build command fires its own set of build events: INIT_BUILD, MAIN_BUILD, and EXIT_BUILD. They're the ones you want to use for anything purely related to building the site.

The watch command ultimately calls the build command so it fires the same set of hooks for each build.

@gvwilson
Copy link
Contributor Author

gvwilson commented Mar 3, 2022

thanks. BTW, I'm with http://deepgenomics.com these days, and we're hiring Python programmers... :-)

@gvwilson
Copy link
Contributor Author

gvwilson commented Mar 3, 2022

works - thank you

@gvwilson gvwilson closed this as completed Mar 3, 2022
@dmulholl
Copy link
Owner

dmulholl commented Mar 3, 2022

Ooooh, that's a really interesting area to work in, pet interest of mine. I've just accepted an offer from a self-driving car company in Berlin, otherwise I'd be all over that. I'll keep an eye on you guys for future opportunities :)

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

No branches or pull requests

2 participants