mirror of
https://github.com/dockur/windows.git
synced 2026-08-24 15:48:59 +01:00
fix: Reduce amount of state variables (#2107)
This commit is contained in:
+3
-18
@@ -1307,6 +1307,7 @@ parseWimHeader() {
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
findImage() {
|
||||
|
||||
local dir="$1"
|
||||
@@ -1353,16 +1354,6 @@ readImageInfo() {
|
||||
return 0
|
||||
}
|
||||
|
||||
getSuggestion() {
|
||||
|
||||
[ -z "$CUSTOM" ] || return 0
|
||||
[ -n "${REUSED_ISO:-}" ] || return 0
|
||||
|
||||
# A reused ISO may still correspond to the originally requested catalog
|
||||
# version, but the suggestion remains only a preference during detection.
|
||||
echo "${SUGGEST:-}"
|
||||
}
|
||||
|
||||
validateEdition() {
|
||||
|
||||
[ -n "$EDITION" ] || return 0
|
||||
@@ -1470,21 +1461,15 @@ detectImageInfo() {
|
||||
|
||||
local image_info="$1"
|
||||
|
||||
local desc suggested index rc
|
||||
local desc index rc
|
||||
|
||||
checkPlatform "$image_info" || {
|
||||
enabled "$DEBUG" && echo "Platform validation failed for the Windows image metadata." >&2
|
||||
exit 67
|
||||
}
|
||||
|
||||
suggested=$(getSuggestion) || {
|
||||
rc=$?
|
||||
enabled "$DEBUG" && echo "Failed to determine the suggested Windows image edition (status $rc)." >&2
|
||||
return "$rc"
|
||||
}
|
||||
|
||||
local output
|
||||
output=$(detectVersion "$image_info" "$suggested") || {
|
||||
output=$(detectVersion "$image_info") || {
|
||||
enabled "$DEBUG" && echo "Version detection failed while parsing the Windows image metadata." >&2
|
||||
error "Failed to detect Windows version from image metadata!"
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user