Switch to https://crates.io/api/v1 for dependency_age.sh

This commit is contained in:
lepapareil 2021-11-29 18:13:53 +01:00 committed by Fabrice Reix
parent 7c3317e8ed
commit be9c5f2a40

View File

@ -10,7 +10,7 @@ color_reset=$(echo -ne "\033[0m")
for package in packages/* ; do
echo -e "\n=> dependency age for ${package}\n"
while read -r dependency actual_version ; do
last_version=$(curl --head "https://docs.rs/${dependency}" 2>&1 | grep --ignore-case "location:" | cut --delimiter "/" --field 5 | grep --extended-regexp "^[0-9].*.[0-9].*.[0-9]$")
last_version=$(curl -kLs https://crates.io/api/v1/crates/${dependency} | jq -r .crate.max_stable_version | grep --extended-regexp "^[0-9].*.[0-9].*.[0-9]$")
if [ -z "${last_version}" ] ; then
echo "${color_red}runtime error${color_reset}, i could not get last version from https://docs.rs/${dependency}"
exit 1