Skip to content

Commit

Permalink
fix: Escape bench script $mktarget
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverRainZ committed Jul 23, 2024
1 parent 9884cdf commit d4b6848
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions utils/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
set -e

sphinxver=v7.3.7
sphinxopts=-Q
mktarget=$(tail -n+25 $(git rev-parse --show-toplevel)/docs/Makefile)

tmpdir=$(mktemp -d)
echo $tmpdir
echo "tmpdir: $tmpdir"
cd $tmpdir

python --version
Expand All @@ -19,21 +20,21 @@ pip show sphinx sphinxnotes-fasthtml

compare() {
echo "" >> index.rst
make SPHINXOPTS=-Q html
make SPHINXOPTS=$sphinxopts html
echo ">>> Standard build"
echo "Another line" >> index.rst
time make SPHINXOPTS=-Q html
time make SPHINXOPTS=$sphinxopts html
echo ">>> Fast build"
echo "Another line" >> index.rst
time make SPHINXOPTS=-Q fasthtml
time make SPHINXOPTS=$sphinxopts fasthtml
}

echo "=== Sphinx"
git clone --quiet --branch $sphinxver --depth 1 https://github.com/sphinx-doc/sphinx.git >/dev/null
cd sphinx/doc
echo "extensions.append('sphinxnotes.fasthtml')" >> conf.py
echo $mktarget >> Makefile
echo "$mktarget" >> Makefile
compare
cd ..

# rm -rf $tmpdir
rm -rf $tmpdir

0 comments on commit d4b6848

Please sign in to comment.