Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tools/compare-site.sh
3544 views
1
#!/usr/bin/env bash
2
# Uses https://github.com/cscheid/quarto-regress to render two versions of a website as
3
# a simple snapshot test. Usage
4
5
# To compare against 1.4.68,
6
# ./tools/compare-site.sh 1.4.68
7
8
v1=$1
9
v2=99.9.9
10
11
remove_numbers () {
12
mkdir -p __compare
13
mv _site __compare/_site_$version
14
cd __compare/_site_$version
15
# remove files that make no sense to compare
16
rm docs/download/_prerelease.json
17
rm _redirects
18
19
## FIXME: we should try to diff the .docx files as well, but we don't right now.
20
find . -name "*.docx" -type f -delete
21
22
find . -name "*.ipynb" -type f -exec gsed -i "s/\"id\"\: \"[0-9a-f-]\+\"/\"id\": \"uuid\"/g" {} \;
23
gsed -i "s/<lastmod>.\\+<\/lastmod>//g" sitemap.xml
24
cd ../..
25
}
26
27
rm -rf __compare
28
29
QUARTO_FORCE_VERSION=0.0.0 qv $v1 render
30
version=$v1
31
remove_numbers
32
33
QUARTO_FORCE_VERSION=0.0.0 quarto render
34
version=$v2
35
remove_numbers
36
37
echo "Diff output:"
38
cd __compare
39
diff -r _site_$v1 _site_$v2
40
cd ..
41
42
43