Skip to content

Commit 383ced8

Browse files
committed
Fix version substitution on docs page
1 parent 7e1e52a commit 383ced8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

documentation/put.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repo="$1"
1010
num="$2"
1111
#date=$3
1212

13-
SD_VERSION="1.0.0"
13+
#SD_VERSION="1.0.0"
1414

1515
# Find main crate name
1616
case $repo in
@@ -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 sed -i "s|<span class=\\\"version\\\">$libVersion</span>|<span class=\\\"version\\\">$versionDescr</span>|g" {} +
138139

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

0 commit comments

Comments
 (0)