mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-11 05:58:40 +00:00
Make screenshotter work with docker-machine (#494)
Since boot2docker has been superseded by docker-machine, we need this to support developers on OS X. The changes to the bash script ensure that we clean up our containers even if taking screenshots gets hung and requires a keyboard interrupt, as happens if the IP addresses were guessed incorrectly.
This commit is contained in:
committed by
Kevin Barabash
parent
f1be1a3462
commit
d50745d5a9
@@ -7,6 +7,15 @@
|
||||
# suitable containers themselves, calling the screenshotter.js script
|
||||
# directly.
|
||||
|
||||
cleanup() {
|
||||
[[ "${container}" ]] \
|
||||
&& docker stop "${container}" >/dev/null \
|
||||
&& docker rm "${container}" >/dev/null
|
||||
container=
|
||||
}
|
||||
|
||||
container=
|
||||
trap cleanup EXIT
|
||||
status=0
|
||||
for browserTag in firefox:2.48.2 chrome:2.48.2; do
|
||||
browser=${browserTag%:*}
|
||||
@@ -23,6 +32,6 @@ for browserTag in firefox:2.48.2 chrome:2.48.2; do
|
||||
status=1
|
||||
fi
|
||||
echo "${res} taking screenshots, stopping and removing ${container:0:12}"
|
||||
docker stop ${container} >/dev/null && docker rm ${container} >/dev/null
|
||||
cleanup
|
||||
done
|
||||
exit ${status}
|
||||
|
Reference in New Issue
Block a user