Skip to content

Instantly share code, notes, and snippets.

@tommystanton
Last active May 7, 2018 00:03
Show Gist options
  • Save tommystanton/5ec743bdbe915991d1b4d2d512a678c7 to your computer and use it in GitHub Desktop.
Save tommystanton/5ec743bdbe915991d1b4d2d512a678c7 to your computer and use it in GitHub Desktop.
Automatically run tests when a source file is modified (Perl 6)
#!/bin/bash
while inotifywait \
--quiet --quiet \
--recursive \
--event close_write \
lib/ @lib/.precomp/ bin/ t/; do \
clear; \
prove --exec perl6 --lib --verbose; \
done
@tommystanton
Copy link
Author

tommystanton commented May 7, 2018

I believe one way to achieve the same setup using entr(1) is something like:

$ ls bin/* lib/*.pm6 t/*.t | entr -cr prove --exec perl6 -v

Also, replacing the ls ... idea with git ls-tree --name-only -r HEAD may also prove useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment