From f7ca0c65b903d1490f4d38e8019ad4b12ee26a5f Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 14 Sep 2025 19:24:52 +0200 Subject: [PATCH] feat: Validate platform variable --- src/mido.sh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/mido.sh b/src/mido.sh index 9d4fcbb..4f80f2e 100644 --- a/src/mido.sh +++ b/src/mido.sh @@ -264,19 +264,17 @@ download_windows_eval() { } case "$enterprise_type" in - "iot" ) - "ltsc" ) - "enterprise" ) - if [[ "${PLATFORM,,}" == "x64" ]]; then - iso_download_link=$(echo "$iso_download_links" | head -n 1) - fi - if [[ "${PLATFORM,,}" == "arm64" ]]; then - iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1) - fi - ;; + "iot" | "ltsc" | "enterprise" ) + case "${PLATFORM,,}" in + "x64" ) + iso_download_link=$(echo "$iso_download_links" | head -n 1) ;; + "arm64" ) + iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1) ;; + * ) + error "Invalid platform specified, value \"$PLATFORM\" is not recognized!" && return 1 ;; + esac ;; "server" ) - iso_download_link=$(echo "$iso_download_links" | head -n 1) - ;; + iso_download_link=$(echo "$iso_download_links" | head -n 1) ;; * ) error "Invalid type specified, value \"$enterprise_type\" is not recognized!" && return 1 ;; esac