Skip to content

Commit

Permalink
fix indent
Browse files Browse the repository at this point in the history
  • Loading branch information
bmo-at-a9s committed Feb 23, 2024
1 parent 877243e commit fddc1fd
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions website/build-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fddc1fd

Please sign in to comment.