Refactor Pop!_OS support to be consistent with other OSs with editions

This commit is contained in:
Martin Wimpress 2022-02-21 15:07:15 +00:00
parent 830c38818a
commit bbcc470751
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
1 changed files with 3 additions and 4 deletions

View File

@ -1289,20 +1289,19 @@ function get_macos() {
} }
function get_popos() { function get_popos() {
local DRIVER="intel" local EDITION=""
local HASH="" local HASH=""
local ISO="" local ISO=""
local URL="" local URL=""
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
DRIVER="${1}" EDITION="${1}"
fi fi
URL=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq ".url") URL=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq ".url")
URL=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${DRIVER}" | jq ".url")
URL="${URL//\"/}" URL="${URL//\"/}"
ISO=$(echo "${URL}" | sed -e "s/.*\/\([^\/]*\)$/\1/") ISO=$(echo "${URL}" | sed -e "s/.*\/\([^\/]*\)$/\1/")
HASH=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${DRIVER}" | jq ".sha_sum") HASH=$(wget -q -O- "https://api.pop-os.org/builds/${RELEASE}/${EDITION}" | jq ".sha_sum")
HASH="${HASH//\"/}" HASH="${HASH//\"/}"
web_get "${URL}" "${VM_PATH}" web_get "${URL}" "${VM_PATH}"
check_hash "${ISO}" "${HASH}" check_hash "${ISO}" "${HASH}"