Skip to content

Commit 98cd3d3

Browse files
authored
Merge pull request #3 from 0xwml/wml/increase-release-cap
support ubuntu versioned assets
2 parents 667e330 + f8e9985 commit 98cd3d3

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

aptos_download.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,21 @@ fi
9595
echo "version: $aptos_version"
9696

9797
if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "freebsd"* || "$OSTYPE" == "cygwin" ]]; then
98-
download_type="Ubuntu-$HOSTTYPE"
98+
base_download_type="Ubuntu-$HOSTTYPE"
99+
100+
# Check if the release has this asset
101+
asset_check=$(cat "$releases_path" | jq -r ".[] | select(${select_prerelease} and .tag_name==\"${aptos_version}\") .assets | .[] | select(.name|test(\"^${aptos_version}-${base_download_type}\")) | .name")
102+
103+
if [[ -z "$asset_check" ]]; then
104+
ubuntu_version=$(lsb_release -sr 2>/dev/null || echo "")
105+
if [[ -n "$ubuntu_version" ]]; then
106+
download_type="Ubuntu-${ubuntu_version}-$HOSTTYPE"
107+
else
108+
download_type=$base_download_type
109+
fi
110+
else
111+
download_type=$base_download_type
112+
fi
99113
elif [[ "$OSTYPE" == "darwin"* ]]; then
100114
download_type="MacOSX-$HOSTTYPE"
101115
elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then

0 commit comments

Comments
 (0)