feat: Check path to boot.iso (#184)

This commit is contained in:
Kroese 2025-02-28 03:55:17 +01:00 committed by GitHub
parent 03115137c8
commit 65fd7c839c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -165,11 +165,16 @@ convertImage() {
findFile() { findFile() {
local ext="$1"
local file local file
local ext="$1"
local fname="boot.$ext"
file=$(find / -maxdepth 1 -type f -iname "boot.$ext" | head -n 1) if [ -d "/$fname" ]; then
[ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "boot.$ext" | head -n 1) warn "The file /$fname has an invalid path!"
fi
file=$(find / -maxdepth 1 -type f -iname "$fname" | head -n 1)
[ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$fname" | head -n 1)
detectType "$file" && return 0 detectType "$file" && return 0
return 1 return 1