-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci+scripts: Pull
sed
invocations out into a script.
Signed-off-by: Philip Conrad <[email protected]>
- Loading branch information
1 parent
5cd9b7a
commit 8f792e3
Showing
3 changed files
with
39 additions
and
9 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
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
_site/* | ||
api/* |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
# This script replaces Speakeasy's relative docs URLs with hyperlinks to | ||
# appropriate DocFX docs for each class/method. | ||
|
||
set -e | ||
|
||
usage() { | ||
echo "Usage:" >&2 | ||
echo " patch-readme.sh <FILENAME> <BASE_URL>" >&2 | ||
echo "Example:" >&2 | ||
echo " patch-readme.sh README.md http://localhost:8080/" >&2 | ||
} | ||
|
||
# Ensure we have enough args. | ||
if [[ $# -lt 2 ]]; then | ||
echo "Not enough parameters provided." >&2 | ||
usage | ||
exit 1 | ||
fi | ||
|
||
# Ensure README file exists. | ||
if [ ! -f $1 ]; then | ||
echo "File '$1' not found!" >&2 | ||
usage | ||
exit 1 | ||
fi | ||
|
||
# OpaApiClient SDK | ||
sed -i "s|(docs/sdks/opaapiclient/README.md)|($2/api/Styra.OpenApi.OpaApiClient.html)|g" $1 | ||
# ExecutePolicy | ||
sed -i "s|(docs/sdks/opaapiclient/README.md#executepolicy)|($2/api/Styra.OpenApi.OpaApiClient.html#Styra_OpenApi_OpaApiClient_ExecutePolicyAsync_Styra_OpenApi_Models_Requests_ExecutePolicyRequest_)|g" $1 | ||
# ExecutePolicyWithInput | ||
sed -i "s|(docs/sdks/opaapiclient/README.md#executepolicywithinput)|($2/api/Styra.OpenApi.OpaApiClient.html#Styra_OpenApi_OpaApiClient_ExecutePolicyWithInputAsync_Styra_OpenApi_Models_Requests_ExecutePolicyWithInputRequest_)|g" $1 | ||
# Health | ||
sed -i "s|(docs/sdks/opaapiclient/README.md#health)|($2/api/Styra.OpenApi.OpaApiClient.html#Styra_OpenApi_OpaApiClient_HealthAsync_System_Nullable_System_Boolean__System_Nullable_System_Boolean__System_Collections_Generic_List_System_String__)|g" $1 | ||
|