Skip to content

Commit

Permalink
picking dem nits
Browse files Browse the repository at this point in the history
  • Loading branch information
yaleman committed May 17, 2024
1 parent 12a6fcd commit a778fb4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,21 @@ for distro in ubuntu debian; do

if [ -z "${SKIP_DOWNLOAD}" ]; then
echo "Grabbing the Kanidm releases url"
RELEASE_URL="$(curl -qLs https://api.github.com/repos/${REPO}/releases | jq -r '.[] | select(.tag_name=="debs") | .assets_url')"
RELEASE_URL="$(curl -qLs "https://api.github.com/repos/${REPO}/releases" | jq -r '.[] | select(.tag_name=="debs") | .assets_url')"

if [ -z "${RELEASE_URL}" ]; then
echo "Failed to get release url"
exit 1
fi

echo "Fetching release info from ${RELEASE_URL}"
urls=($(curl -qLs "$RELEASE_URL" | jq '.[] | .browser_download_url' | grep -i "$distro" | tr -d \"))
if [ $? -ne 0 ]; then
urls=()
IFS=" " read -r -a urls <<< "$(curl -qLs "$RELEASE_URL" | jq '.[] | .browser_download_url' | grep -i "$distro" | tr -d \")"
if [ ${#urls[@]} -eq 0 ]; then
echo "Release doesn't have any files for $distro"
exit 1
else
echo "Release has ${#urls[@]} files for $distro"
exit
else
echo "Release has ${#urls[@]} files for $distro"
fi
for url in "${urls[@]}"; do
../download.sh "$url" || exit 1
Expand Down

0 comments on commit a778fb4

Please sign in to comment.