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

Feature request: Don't run prep: commands on first run #7

Closed
andrewhowdencom opened this issue Feb 11, 2016 · 4 comments
Closed

Feature request: Don't run prep: commands on first run #7

andrewhowdencom opened this issue Feb 11, 2016 · 4 comments

Comments

@andrewhowdencom
Copy link

This tool is super nice, and is benefiting me greatly with some web development stuff. However, each time I modify the config and restart it, all prep commands are run. They're then subsequently run when the files matching are modified.

I'm using the application to trigger application changes (so, clearing cache, recompiling CSS) when there are file changes. It's not necessary that all of these things be completed when modd is first run -- Only when it changes.

Is it possible to introduce a flag that disables the "inital run" option, and just runs on modification?

Thanks again!

@cortesi
Copy link
Owner

cortesi commented Feb 11, 2016

Hey there. This sounds like a sensible extension. I wonder if this is something that would best be done as a command-line flag, or whether we need to somehow support this in the config file on a per-rule basis. Do you have a use-case that leans either way?

Adding a flag do disable first-run would be really easy, and might be needed even if conf file support is desirable. I'd definitely merge a patch that does this. :)

@andrewhowdencom
Copy link
Author

Per rule basis would suit me better - Cache clearing doesn't really need doing before the application has had a chance to build the cache. Intuitively, command line flag feels like the wrong interface for this, but that's just a feeling.

I can certainly have a crack into writing a patch, though this would be my first venture into golang. If you're happy for me to do so, I'll take a look sometime this weekend-ish.

@cortesi
Copy link
Owner

cortesi commented Feb 14, 2016

Hi Andrew. Yes, I think a +onchange flag for prep commands would do the trick here. So, the syntax would look like this:

prep +onchange: ./clear_cache

The parser for flags is already there, so this should be a relatively simple change. Please feel free to have a crack, and let me know if you'd like to discuss.

@andrewhowdencom
Copy link
Author

Just wanted to thank @homburg for this!

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