Skip to content

Commit

Permalink
Merge pull request #1 from nullun/latest-opcode-docs
Browse files Browse the repository at this point in the history
Link to the latest version of the opcodes page
  • Loading branch information
jasonpaulos authored Oct 4, 2023
2 parents 0952a12 + 3f79455 commit 792b216
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/reformat-all-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ CLI_TOOLS="~/go/bin/" # path to goal, algorand-indexer, algokey, etc.
cp $GO_ALGORAND_SRC/data/transactions/logic/jsonspec.md ../docs/get-details/dapps/avm/teal/jsonspec.md
cp $GO_ALGORAND_SRC/data/transactions/logic/README.md ../docs/get-details/dapps/avm/teal/specification.md
sed -i.bak '1s/#/title:/' ../docs/get-details/dapps/avm/teal/specification.md
sed -i.bak 's/TEAL_opcodes.md/..\/opcodes/' ../docs/get-details/dapps/avm/teal/specification.md

# TEAL - OPCODES DIRECTORY
rm -rf ../docs/get-details/dapps/avm/teal/opcodes
Expand Down Expand Up @@ -78,6 +77,10 @@ sorted_files=($(for file in "${opcode_files[@]}"; do
echo "$(get_version_number "$file") $file"
done | sort -n | awk '{print $2}'))

# Link to latest opcodes
latest_version="$(get_version_number ${sorted_files[${#sorted_files[@]}-1]})"
sed -i.bak "s/TEAL_opcodes.md/opcodes\/v${latest_version}.md/" ../docs/get-details/dapps/avm/teal/specification.md

for ((i=${#sorted_files[@]}-1; i>=0; i--)); do
file=${sorted_files[$i]}
if [ -f "$file" ]; then
Expand Down

0 comments on commit 792b216

Please sign in to comment.