Skip to content

Commit e3f4c17

Browse files
committed
Fix version substitution on docs page
1 parent 373ac08 commit e3f4c17

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

documentation/put.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ echo "$PRE start PUT operation (crate '$mainCrate')."
4444
if [[ "$num" == "master" ]]; then
4545
gitRef="master"
4646
dir="$repo/master"
47-
prettyNum="Latest master"
47+
versionDescr="Latest master"
4848
else
4949
gitRef="pull/$num/head"
5050
dir="$repo/pr-$num"
51-
prettyNum="Pull Request #$num"
51+
versionDescr="Pull Request #$num"
5252
fi
5353

5454
# Checkout PR branch
@@ -131,7 +131,8 @@ fi
131131
# Recognize min crate version, replace with current PR/master version
132132
libVersion=$(grep -Po '^version = "\K[^"]*' "cloned/$mainCrate/Cargo.toml")
133133
echo "$PRE detected crate: $mainCrate v$libVersion."
134-
find "target/doc/$mainCrate" -name .html -o -type f -print0 | xargs -0 sed -i 's/'"Version $libVersion"'/'"$prettyNum"'/g'
134+
find target/doc/"$mainCrate" -type f -name "*.html" \
135+
-exec sd "<span class=\\\"version\\\">$libVersion</span>" "<span class=\\\"version\\\">$versionDescr</span>" {} +
135136

136137
# Copy docs
137138
echo "$PRE deploy docs for #$num..."

0 commit comments

Comments
 (0)