generated from fastai/fastpages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_js.sh
executable file
·25 lines (22 loc) · 1.37 KB
/
check_js.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# The purpose of this script is to check parity between official hosted third party js libraries, and alternative CDNs used on this site.
function compare {
printf "=================\ncomparing:\n%s vs. %s\n" "$1" "$2"
wget "$1" -O f1 &> /dev/null
wget "$2" -O f2 &> /dev/null
if ! cmp f1 f2;
then
printf "Files are NOT the same!\n"
exit 1;
else
printf "Files are the same.\n"
fi
}
compare "https://unpkg.com/@primer/css/dist/primer.css" "https://cdnjs.cloudflare.com/ajax/libs/Primer/15.2.0/primer.css"
#compare "https://hypothes.is/embed.js" "https://cdn.jsdelivr.net/npm/hypothesis/build/boot.js"
compare "https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/contrib/auto-render.min.js"
compare "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css"
compare "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.js"
compare "https://cdn.jsdelivr.net/npm/[email protected]/MathJax.js" "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"
# Remove files created for comparison
rm f1 f2