Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Fix release script to properly handle docs updates #306

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ node_modules/
npm-debug.log
tmp/
examples/typescript/facoin/facoin.json
*.bak

# Vim swap files
*.swp
5 changes: 0 additions & 5 deletions docs/@aptos-labs/ts-sdk-latest/index.md.bak

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ redirect_from:

## SDK Versions

- [Stable - @aptos-labs/ts-sdk-1.8.0](@aptos-labs/ts-sdk-1.8.0)
This is a repository of all Aptos TypeScript SDK documentation by version.

- [Latest](@aptos-labs/ts-sdk-latest)
- [Stable - @aptos-labs/ts-sdk-1.8.0](@aptos-labs/ts-sdk-1.8.0)
- [Stable - @aptos-labs/ts-sdk-1.7.0](@aptos-labs/ts-sdk-1.7.0)
- [Stable - @aptos-labs/ts-sdk-1.6.0](@aptos-labs/ts-sdk-1.6.0)
- [Stable - @aptos-labs/ts-sdk-1.5.1](@aptos-labs/ts-sdk-1.5.1)
Expand Down
4 changes: 2 additions & 2 deletions scripts/generateDocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ else
echo "Updating main docs page $INDEX_FILE with version $npm_package_version labeled with $LABEL";

# This inserts it at the 7th line and is a hack because there are exactly 7 lines until the first SDK version in the file
FIRST_LINE=8
FIRST_LINE=11
NEXT_LINE=$((FIRST_LINE + 1))

# Add in the middle line the new version.
Expand All @@ -44,5 +44,5 @@ fi

# Now update the redirect
REDIRECT_FILE='docs/@aptos-labs/ts-sdk-latest/index.md';
$(sed -i.bak "s/- ts-sdk-.*/- ts-sdk-$npm_package_version/" $REDIRECT_FILE)
$(sed -i.bak "s/redirect_to:.*/redirect_to: \/@aptos-labs\/ts-sdk-${npm_package_version}/" $REDIRECT_FILE)
echo "Updated redirect $REDIRECT_FILE with version $npm_package_version for latest";
Loading