File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7878if [[ $aptos_version == " latest" || $aptos_version == " new" || $aptos_version == " last" || -z $aptos_version ]]; then
7979 # Get the latest version
8080 # !! Temporary fix due to Aptos not using the same standard release names and versions every time
81- aptos_version=" aptos-cli-v0.1.2"
81+ aptos_version=" aptos-cli-v0.1.2" ;
82+ version_tag=$( cat " $releases_path " | jq -r ' .[] | select(("${select_prerelease}") and (.tag_name | contains("cli"))) .tag_name' | head -n1) ;
8283 # aptos_version=$(cat "$releases_path" | jq -r '.[] | select(("${select_prerelease}") and (.tag_name | contains("cli"))) .tag_name' | head -n1);
8384 # if [[ -z $aptos_version ]]; then
8485 # echo "{$aptos_version|$APTOS_PRERELEASE} The specified version of aptos was not found";
@@ -110,8 +111,13 @@ asset_filename=$(echo $filename | sed 's/v//')
110111file_path=" $aptosfolder /$filename "
111112unziped_file_path=" $aptosfolder /aptos"
112113
113- download_url=$( cat " $releases_path " |
114- jq -r " .[] | select(${select_prerelease} and .tag_name==\" ${aptos_version} \" ) .assets | .[] | select(.name|test(\" ^${asset_filename} \" )) | .browser_download_url" )
114+ if [[ -z $version_tag ]]; then
115+ download_url=$( cat " $releases_path " |
116+ jq -r " .[] | select(${select_prerelease} and .tag_name==\" ${aptos_version} \" ) .assets | .[] | select(.name|test(\" ^${asset_filename} \" )) | .browser_download_url" )
117+ else
118+ download_url=$( cat " $releases_path " |
119+ jq -r " .[] | select(${select_prerelease} and .tag_name==\" ${version_tag} \" ) .assets | .[] | select(.name|test(\" ^${asset_filename} \" )) | .browser_download_url" )
120+ fi
115121if [ -z $download_url ]; then
116122 download_url=$( cat " $releases_path " |
117123 jq -r " .[] | select(${select_prerelease} and .tag_name==\" ${aptos_version} \" ) .assets | .[] | select(.name|test(\" ^${aptos_version} -${download_type} \" )) | .browser_download_url" )
You can’t perform that action at this time.
0 commit comments