mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
* Update texcmp to ubuntu 17.04 and avoid mounted host directory Switch to linux 17.04 in order to have a version of nodejs which understands ES6 syntax, for the sake of a consistent codebase. Avoid mounting the host directory, but use “docker cp” instead to transfer files between host and container. This should avoid ownership and permission issues. Support macros with positional arguments. Fix one overline example which caused LaTeX failure due to missing braces. * Extract texcmp results as current user This allows running the texcmp.sh script using sudo on afs. * Change texcmp conversion to gray As per #708, this should increase compatibility with older versions of imagemagick, and might also do a better job of preserving the original sRGB color space. * Abandon tar and use plain docker cp instead Thanks to Erik Demaine for suggesting this. * Move npm install into creation of texcmp docker image
35 lines
971 B
Bash
Executable File
35 lines
971 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -x
|
|
imgname=katex/texcmp
|
|
tag=1.3
|
|
imgid=$(docker images | awk "/${imgname//\//\\/} *${tag//./\\.}/{print \$3}")
|
|
cd "$(dirname "$0")" || exit $?
|
|
if [[ -z ${imgid} ]]; then
|
|
docker build -t "${imgname}:${tag}" . || exit $?
|
|
fi
|
|
|
|
cd ../..
|
|
mkdir -p test/screenshotter/{tex,diff}
|
|
|
|
cleanup() {
|
|
[[ "${container}" ]] \
|
|
&& docker stop "${container}" >/dev/null \
|
|
&& docker rm "${container}" >/dev/null
|
|
container=
|
|
}
|
|
container=$(docker create -t -u 0:0 \
|
|
-w /KaTeX/dockers/texcmp \
|
|
"${imgname}:${tag}" \
|
|
nodejs texcmp.js "$@")
|
|
trap cleanup EXIT
|
|
tar c dockers/texcmp/{texcmp.js,package.json} \
|
|
test/screenshotter/{ss_data.{js,yaml},images/*-firefox.png,test.tex} \
|
|
| docker cp - "${container}:/KaTeX"
|
|
docker start -a "${container}"
|
|
docker cp "${container}:/KaTeX/test/screenshotter/tex" test/screenshotter \
|
|
|| exit $?
|
|
docker cp "${container}:/KaTeX/test/screenshotter/diff" test/screenshotter \
|
|
|| exit $?
|
|
cleanup
|