fix: Simplify conditional checks

This commit is contained in:
Kroese 2025-09-21 15:11:03 +02:00 committed by GitHub
parent bfc9b357e5
commit 9e9e7b5c48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1269,7 +1269,7 @@ getValue() {
local type="$4" local type="$4"
local func="getLink$1" local func="getLink$1"
if [ "$1" -gt 0 ] && [ "$1" -le "$MIRRORS" ]; then if [ "$1" -gt 0 && "$1" -le "$MIRRORS" ]; then
val=$($func "$id" "$lang" "$type") val=$($func "$id" "$lang" "$type")
fi fi
@ -1394,7 +1394,7 @@ prepareInstall() {
ETFS="[BOOT]/Boot-NoEmul.img" ETFS="[BOOT]/Boot-NoEmul.img"
if [ ! -f "$dir/$ETFS" ] || [ ! -s "$dir/$ETFS" ]; then if [ ! -f "$dir/$ETFS" || ! -s "$dir/$ETFS" ]; then
error "Failed to locate file \"$ETFS\" in $desc ISO image!" && return 1 error "Failed to locate file \"$ETFS\" in $desc ISO image!" && return 1
fi fi
@ -1478,7 +1478,7 @@ prepareInstall() {
local key setup local key setup
setup=$(find "$target" -maxdepth 1 -type f -iname setupp.ini -print -quit) setup=$(find "$target" -maxdepth 1 -type f -iname setupp.ini -print -quit)
if [ -n "$setup" ] && [ -z "$KEY" ]; then if [ -n "$setup" & -z "$KEY" ]; then
pid=$(<"$setup") pid=$(<"$setup")
pid="${pid%$'\r'}" pid="${pid%$'\r'}"
@ -1795,7 +1795,7 @@ prepareLegacy() {
ETFS="boot.img" ETFS="boot.img"
[ -f "$dir/$ETFS" ] && [ -s "$dir/$ETFS" ] && return 0 [ -f "$dir/$ETFS" && -s "$dir/$ETFS" ] && return 0
rm -f "$dir/$ETFS" rm -f "$dir/$ETFS"
local len offset local len offset
@ -1806,7 +1806,7 @@ prepareLegacy() {
error "Failed to extract boot image from $desc ISO!" && return 1 error "Failed to extract boot image from $desc ISO!" && return 1
fi fi
[ -f "$dir/$ETFS" ] && [ -s "$dir/$ETFS" ] && return 0 [ -f "$dir/$ETFS" && -s "$dir/$ETFS" ] && return 0
error "Failed to locate file \"$ETFS\" in $desc ISO image!" error "Failed to locate file \"$ETFS\" in $desc ISO image!"
return 1 return 1