fix: logs are now followed though a localnet restart

This commit is contained in:
Michael Vines 2018-10-13 10:54:37 -07:00
parent 1436eca398
commit 3f2d1c4352
1 changed files with 20 additions and 1 deletions

View File

@ -77,9 +77,28 @@ down)
)
;;
logs)
follow=false
if [[ -n $1 ]]; then
if [[ $1 = "-f" ]]; then
follow=true
else
usage "Unknown argument: $1"
fi
fi
while $follow; do
if [[ -n $(docker ps -q -f name=solana-localnet) ]]; then
(
set -x
docker logs solana-localnet -f
) || true
fi
sleep 1
done
(
set -x
docker logs solana-localnet "$@"
docker logs solana-localnet
)
;;
*)