fix: link clicks empty array validation

This commit is contained in:
Juan Rodriguez
2024-07-12 18:59:46 +02:00
parent cebbd48237
commit 8f33375b5f
5 changed files with 8 additions and 7 deletions
+3 -1
View File
@@ -67,8 +67,8 @@ function measure {
--header "X-Api-Key: $api_key" \
--header "Content-Type: application/json" \
--data "{ \"url\": \"https://kagi.com\" }")
refer=$(echo $response | awk -F'"' '/"refer":/{print $(NF-1)}')
if [[ -n $refer ]]; then
refer_links+=("$refer")
if (( i % 100 == 0 )); then
@@ -76,6 +76,8 @@ function measure {
fi
else
echo "Failed to create short link $i"
echo $response
exit 1
fi
done