mirror of
https://github.com/dockur/windows.git
synced 2024-07-01 03:31:56 +00:00
feat: Refactor download code
This commit is contained in:
parent
c1d6ec9ffe
commit
34f9d45108
|
@ -377,47 +377,6 @@ switchEdition() {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
getCatalog() {
|
|
||||||
|
|
||||||
local id="$1"
|
|
||||||
local ret="$2"
|
|
||||||
local url=""
|
|
||||||
local name=""
|
|
||||||
local edition=""
|
|
||||||
|
|
||||||
case "${id,,}" in
|
|
||||||
"win11${PLATFORM,,}" )
|
|
||||||
edition="Professional"
|
|
||||||
name="Windows 11 Pro"
|
|
||||||
url="https://go.microsoft.com/fwlink?linkid=2156292"
|
|
||||||
;;
|
|
||||||
"win10${PLATFORM,,}" )
|
|
||||||
edition="Professional"
|
|
||||||
name="Windows 10 Pro"
|
|
||||||
url="https://go.microsoft.com/fwlink/?LinkId=841361"
|
|
||||||
;;
|
|
||||||
"win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval")
|
|
||||||
edition="Enterprise"
|
|
||||||
name="Windows 11 Enterprise"
|
|
||||||
url="https://go.microsoft.com/fwlink?linkid=2156292"
|
|
||||||
;;
|
|
||||||
"win10${PLATFORM,,}-enterprise" | "win10${PLATFORM,,}-enterprise-eval" )
|
|
||||||
edition="Enterprise"
|
|
||||||
name="Windows 10 Enterprise"
|
|
||||||
url="https://go.microsoft.com/fwlink/?LinkId=841361"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "${ret,,}" in
|
|
||||||
"url" ) echo "$url" ;;
|
|
||||||
"name" ) echo "$name" ;;
|
|
||||||
"edition" ) echo "$edition" ;;
|
|
||||||
*) echo "";;
|
|
||||||
esac
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
getMido() {
|
getMido() {
|
||||||
|
|
||||||
local id="$1"
|
local id="$1"
|
||||||
|
@ -950,10 +909,18 @@ isMido() {
|
||||||
isESD() {
|
isESD() {
|
||||||
|
|
||||||
local id="$1"
|
local id="$1"
|
||||||
local url
|
|
||||||
|
|
||||||
url=$(getCatalog "$id" "url")
|
case "${id,,}" in
|
||||||
[ -n "$url" ] && return 0
|
"win11${PLATFORM,,}" | "win10${PLATFORM,,}" )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval")
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
"win10${PLATFORM,,}-enterprise" | "win10${PLATFORM,,}-enterprise-eval" )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue