Skip to content

Instantly share code, notes, and snippets.

@marczhermo
Created April 28, 2021 10:11
Show Gist options
  • Save marczhermo/6333bfd09c66cf969e21b0366820a8f2 to your computer and use it in GitHub Desktop.
Save marczhermo/6333bfd09c66cf969e21b0366820a8f2 to your computer and use it in GitHub Desktop.
Watcher using inotifywait for running phpunit
#!/bin/sh
# Example command
# ./phpunitwatch.sh app/tests/Jobs/CityCountryImportJobTest.php
# ./phpunitwatch.sh app/tests/Jobs/CityCountryImportJobTest.php --coverage-text
while inotifywait -e modify $1
do
clear && vendor/bin/phpunit $1 $2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment