Skip to content

Commit

Permalink
Link to the latest version of the opcodes page
Browse files Browse the repository at this point in the history
  • Loading branch information
nullun committed Oct 4, 2023
1 parent 0952a12 commit 3f79455
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 3f79455

Please sign in to comment.