forked from cloudfoundry/stratos
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
877243e
commit fddc1fd
Showing
1 changed file
with
16 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,22 +51,22 @@ function createVersionedDocs() ( | |
|
||
# Workaround for broken links in versions 4.4.0 and before | ||
printf '%s\n%s\n' "$target_version" "$version" | sort -V | head -n1 | ||
if [[ $? -eq 0 ]]; then | ||
logInner "Version is 4.4.0 or less, applying workaround for broken links and v3 upgrade" | ||
gnu_sed=sed | ||
if [[ "$(uname)" == "Darwin" ]]; then | ||
gnu_sed=gsed | ||
fi | ||
echo $gnu_sed | ||
# Fix links to cloud-foundry.md | ||
find $checkedOutRepo/website/versioned_docs/version-$label -type f -name "*.md" -exec ${gnu_sed} -i 's/cloud-foundry\/cloud-foundry/cloud-foundry\/cloud-foundry.md/g' {} \; | ||
# Fix other links to cloud-foundry.md | ||
find $checkedOutRepo/website/versioned_docs/version-$label -type f -name "*.md" -exec ${gnu_sed} -i 's/](cloud-foundry)/(cloud-foundry.md)/g' {} \; | ||
# Escape commit signing in contributers guide (v3 upgrade) | ||
find $checkedOutRepo/website/versioned_docs/version-$label -type f -name "*.md" -exec ${gnu_sed} -i 's/ Signed-off-by: Joe Smith <[email protected]>/```\nSigned-off-by: Joe Smith <[email protected]>\n```/g' {} \; | ||
# Remove versions from sidebars (v3 upgrade) | ||
find $checkedOutRepo/website/versioned_sidebars -type f -name "*.json" -exec ${gnu_sed} -i 's/version-[0-9]\.[0-9]\.[0-9]\///g' {} \; | ||
fi | ||
if [[ $? -eq 0 ]]; then | ||
logInner "Version is 4.4.0 or less, applying workaround for broken links and v3 upgrade" | ||
gnu_sed=sed | ||
if [[ "$(uname)" == "Darwin" ]]; then | ||
gnu_sed=gsed | ||
fi | ||
echo $gnu_sed | ||
# Fix links to cloud-foundry.md | ||
find $checkedOutRepo/website/versioned_docs/version-$label -type f -name "*.md" -exec ${gnu_sed} -i 's/cloud-foundry\/cloud-foundry/cloud-foundry\/cloud-foundry.md/g' {} \; | ||
# Fix other links to cloud-foundry.md | ||
find $checkedOutRepo/website/versioned_docs/version-$label -type f -name "*.md" -exec ${gnu_sed} -i 's/](cloud-foundry)/(cloud-foundry.md)/g' {} \; | ||
# Escape commit signing in contributers guide (v3 upgrade) | ||
find $checkedOutRepo/website/versioned_docs/version-$label -type f -name "*.md" -exec ${gnu_sed} -i 's/ Signed-off-by: Joe Smith <[email protected]>/```\nSigned-off-by: Joe Smith <[email protected]>\n```/g' {} \; | ||
# Remove versions from sidebars (v3 upgrade) | ||
find $checkedOutRepo/website/versioned_sidebars -type f -name "*.json" -exec ${gnu_sed} -i 's/version-[0-9]\.[0-9]\.[0-9]\///g' {} \; | ||
fi | ||
# End of workaround | ||
|
||
cp -r $checkedOutRepo/website/versioned_docs/version-$label $currentWebsite/versioned_docs | ||
|