ttrss/utils/phpstan-watcher.sh

24 lines
650 B
Bash
Raw Permalink Normal View History

2022-07-31 08:13:17 +00:00
#!/bin/sh
export PHP_IMAGE=registry.fakecake.org/infra/php8.3-alpine:3.19
docker run --rm -v $(pwd):/app -v /tmp/phpstan:/tmp/phpstan \
--workdir /app ${PHP_IMAGE} \
php83 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G --error-format=raw analyze .
echo All done, RC=$?.
2022-07-31 08:13:17 +00:00
while true; do
inotifywait . -e close_write -r -t 300 | grep -q .php && \
(
MODIFIED=$(git ls-files -m | grep .php)
docker run --rm -v $(pwd):/app -v /tmp/phpstan:/tmp/phpstan \
--workdir /app ${PHP_IMAGE} \
php83 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G --error-format=raw analyze .
2022-07-31 08:13:17 +00:00
echo All done, RC=$?.
)
sleep 1
done