forked from w3c/aria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pr-preview.sh
executable file
·46 lines (43 loc) · 2.59 KB
/
pr-preview.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# change specStatus value to include relative paths
echo "Updating specStatus to unofficial"
find . -name "index.html" -exec sed -i 's/specStatus:[[:space:]]*"ED"/specStatus: "unofficial"/g' {} +
# update spec URLs mappings for ARIA
echo "updating ARIA mappings"
find . -wholename "./index.html" -exec sed -i 's/ariaSpecURLs: {/ariaSpecURLs: {\n "unofficial": "\/",/g' {} +
find . -wholename "./index.html" -exec sed -i 's/accNameURLs: {/accNameURLs: {\n "unofficial": ".\/accname\/",/g' {} +
find . -wholename "./index.html" -exec sed -i 's/coreMappingURLs: {/coreMappingURLs: {\n "unofficial": ".\/core-aam\/",/g' {} +
# update child specs URLs mapping
echo "updating child spec URL mappings"
# aria
find . -mindepth 1 -name "index.html" -exec sed -i 's/ariaSpecURLs: {/ariaSpecURLs: {\n "unofficial": "..\/",/g' {} +
# accname
find . -mindepth 1 -name "index.html" -exec sed -i 's/accNameURLs: {/accNameURLs: {\n "unofficial": "..\/accname\/",/g' {} +
# core-aam
find . -mindepth 1 -name "index.html" -exec sed -i 's/coreMappingURLs: {/coreMappingURLs: {\n "unofficial": "..\/core-aam\/",/g' {} +
# dpub
find . -mindepth 1 -name "index.html" -exec sed -i 's/dpubModURLs: {/dpubModURLs: {\n "unofficial": "..\/dpub-aria\/",/g' {} +
# graphicsMappingModURLs
find . -mindepth 1 -name "index.html" -exec sed -i 's/graphicsMappingModURLs: {/graphicsMappingModURLs: {\n "unofficial": "..\/graphics-aam\/",/g' {} +
# graphicsModURLs
find . -mindepth 1 -name "index.html" -exec sed -i 's/graphicsModURLs: {/graphicsModURLs: {\n "unofficial": "..\/graphics-aria\/",/g' {} +
# htmlMappingURLs
find . -mindepth 1 -name "index.html" -exec sed -i 's/htmlMappingURLs: {/htmlMappingURLs: {\n "unofficial": "..\/html-aam\/",/g' {} +
# build all specs
echo "building specs"
commands=(
"npx respec -s index.html -o index.html --localhost"
"npx respec -s accname/index.html -o accname/index.html --localhost"
"npx respec -s core-aam/index.html -o core-aam/index.html --localhost"
"npx respec -s dpub-aam/index.html -o dpub-aam/index.html --localhost"
"npx respec -s dpub-aria/index.html -o dpub-aria/index.html --localhost"
"npx respec -s graphics-aam/index.html -o graphics-aam/index.html --localhost"
"npx respec -s graphics-aria/index.html -o graphics-aria/index.html --localhost"
"npx respec -s svg-aam/index.html -o svg-aam/index.html --localhost"
"npx respec -s mathml-aam/index.html -o mathml-aam/index.html --localhost"
)
for cmd in "${commands[@]}"; do
echo "Executing: $cmd"
if ! $cmd; then
echo "Error: Command failed - $cmd"
fi
done