Skip to content

Commit 4d3f978

Browse files
committed
wip
1 parent fb9d997 commit 4d3f978

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

doc/build_antora.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ elif [ -n "${GITHUB_REPOSITORY:-}" ]; then
3434
sha=${GITHUB_SHA}
3535
fi
3636

37-
base_url="https://github.com/${repository}/blob/${sha}"
38-
39-
if [ -n "${base_url}" ]; then
37+
if [ -n "${sha}" ]; then
38+
base_url="https://github.com/${repository}/blob/${sha}"
4039
echo "Setting base-url to $base_url"
4140
cp mrdocs.yml mrdocs.yml.bak
4241
perl -i -pe 's{^\s*base-url:.*$}{base-url: '"$base_url/"'}' mrdocs.yml
43-
perl -i -pe 's/{{BASE_URL}}/$base_url/g' html/openmethod/ref_headers.html
42+
perl -i -pe "s[{{BASE_URL}}][$base_url]g" html/openmethod/ref_headers.html
4443
fi
4544

4645
echo "Building documentation with Antora..."
@@ -58,7 +57,7 @@ for f in $(find html -name '*.html'); do
5857
perl -i -pe 's{&lcub;&lcub;(.*?)&rcub;&rcub;}{<a href="../../../$1.html">$1</a>}g' "$f"
5958
done
6059

61-
if [ -n "${base_url:-}" ]; then
60+
if [ -n "${sha:-}" ]; then
6261
if [ -f mrdocs.yml.bak ]; then
6362
mv -f mrdocs.yml.bak mrdocs.yml
6463
echo "Restored original mrdocs.yml"

0 commit comments

Comments
 (0)