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

Watcher / After build command #40

Merged
merged 3 commits into from
Jul 21, 2023
Merged

Watcher / After build command #40

merged 3 commits into from
Jul 21, 2023

Conversation

rolandpeelen
Copy link
Member

@rolandpeelen rolandpeelen commented Jul 21, 2023

This is an issue when running things like a test watcher simultaniously
with Rewatch. Because of the amount of IO Rewacht produces, the watcher
in the secondary thread get's respawned over-and-over, making it produce
more IO than needed. This allows the user to pass in a subcommand to be
ran whenever the build has finished. IE:

rewatch watch . -a "yarn jest foo.test"

Or, when there are longer build times, alert the user that the build is
finished.

rewatch watch . -a "tput bel"

Effectively this means we have a way for the user to tap into the watcher, and spawn commands there, rather than relying on starting an additional watcher.

@rolandpeelen rolandpeelen changed the title Watcher command Watcher / After build command Jul 21, 2023
Copy link
Collaborator

@jfrolich jfrolich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Roland Peelen added 3 commits July 21, 2023 12:23
This is an issue when running things like a test watcher simultaniously
with Rewatch. Because of the amount of IO Rewacht produces, the watcher
in the secondary thread get's respawned over-and-over, making it produce
more IO than needed. This allows the user to pass in a subcommand to be
ran whenever the build has finished. IE:

```
rewatch watch . -a "yarn jest foo.test"
```

Or, when there are longer build times, alert the user that the build is
finished.

```
rewatch watch . -a "tput bel"
```
@rolandpeelen rolandpeelen merged commit 1eebd72 into master Jul 21, 2023
4 checks passed
@zth
Copy link
Contributor

zth commented Jul 21, 2023

This is cool and quite useful for codegen tools that rely on build artifacts, like ResGraph (https://github.com/zth/resgraph). One thought I had - would it be feasible to track and relay a list of all files that rebuilt to the command that gets invoked?

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.

3 participants