Skip to content

Commit

Permalink
chore: msg fixup
Browse files Browse the repository at this point in the history
Fixup messages.

Signed-off-by: Ryan Johnson <[email protected]>
  • Loading branch information
tenthirtyam committed Apr 15, 2024
1 parent 669a4a5 commit 4bd1d83
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ select_download() {
download_link=$(jq -r --arg os "$os" --arg dist "$dist" --arg version "$version" --arg arch "$arch" '.os[] | select(.name == $os) | .types[] | select(.description == $dist) | .versions[$version][] | .architectures[] | select(.architecture == $arch) | .download_link' $json_path)
# Validate the download link
if curl --output /dev/null --silent --head --fail "$download_link"; then
download_dir="$(echo "${iso_base_path}/${os}/${dist}/${version}/${arch}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')"
download_dir="$(echo "${iso_base_path}/${os}/${dist}/${version}/${arch}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')"
else
echo "Download link $download_link not valid. Skip download."
return
print_message invalid "Invalid download link provided in JSON configuration: $download_link"
return
fi
mkdir -p "$download_dir"

Expand All @@ -360,9 +360,8 @@ select_download() {
# Check if iso file exists in the download directory.
iso_check=$(find "$download_dir" -type f -name "*.iso")
if [ -n "$iso_check" ]; then
echo "ISO files found:"
echo "$iso_check"
return
print_message skipped "Existing ISO file found: $iso_check"
return
fi

printf "\n"
Expand Down Expand Up @@ -447,9 +446,8 @@ select_download() {
# Check if iso file exists in the download directory.
iso_check=$(find "$download_dir" -type f -name "*.iso")
if [ -n "$iso_check" ]; then
echo "ISO files found:"
echo "$iso_check"
return
print_message skipped "Existing ISO file found: $iso_check"
return
fi

printf "\n"
Expand Down Expand Up @@ -478,10 +476,10 @@ select_download() {
download_link=$(jq -r --arg os "$os" --arg dist "$dist" --arg version "$version" --arg arch "$arch" '.os[] | select(.name == $os) | .distributions[] | select(.description == $dist) | .versions | to_entries[] | .value[] | select(.version == $version) | .architectures[] | select(.architecture == $arch) | .download_link' $json_path)
# Validate the download link
if curl --output /dev/null --silent --head --fail "$download_link"; then
download_dir="$(echo "${iso_base_path}/${os}/${dist}/${version}/${arch}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')"
download_dir="$(echo "${iso_base_path}/${os}/${dist}/${version}/${arch}" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')"
else
echo "Download link $download_link not valid. Skip download."
return
print_message invalid "Invalid download link provided in JSON configuration: $download_link"
return
fi
mkdir -p "$download_dir"

Expand All @@ -492,9 +490,8 @@ select_download() {
# Check if iso file exists in the download directory.
iso_check=$(find "$download_dir" -type f -name "*.iso")
if [ -n "$iso_check" ]; then
echo "ISO files found:"
echo "$iso_check"
return
print_message skipped "Existing ISO file found: $iso_check"
return
fi

printf "\n"
Expand Down Expand Up @@ -811,4 +808,3 @@ done
# TODO:
# - Add support for headless logging with timestamps.
# - Add support for SUSE Enterprise Linux Server download. Headless Chrome?
# - Add support for checking the download links for availability, but do not download the files.

0 comments on commit 4bd1d83

Please sign in to comment.