Skip to content

Commit 0f4a0d7

Browse files
committed
Fix version substitution on docs page
1 parent 7e1e52a commit 0f4a0d7

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
@@ -134,7 +134,8 @@ fi
134134
# Recognize min crate version, replace with current PR/master version
135135
libVersion=$(grep -Po '^version = "\K[^"]*' "cloned/$mainCrate/Cargo.toml")
136136
echo "$PRE detected crate: $mainCrate v$libVersion."
137-
find "target/doc/$mainCrate" -name .html -o -type f -print0 | xargs -0 sed -i 's/'"Version $libVersion"'/'"$prettyNum"'/g'
137+
find target/doc/"$mainCrate" -type f -name "*.html" \
138+
-exec sd "<span class=\\\"version\\\">$libVersion</span>" "<span class=\\\"version\\\">$versionDescr</span>" {} +
138139

139140
# Copy docs
140141
echo "$PRE deploy docs for #$num..."

0 commit comments

Comments
 (0)