Unverified Commit f3fafa65 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

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

parent a13a8245
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -165,11 +165,16 @@ convertImage() {

findFile() {

  local ext="$1"
  local file
  local ext="$1"
  local fname="boot.$ext"

  if [ -d "/$fname" ]; then
    warn "The file /$fname has an invalid path!"
  fi

  file=$(find / -maxdepth 1 -type f -iname "boot.$ext" | head -n 1)
  [ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "boot.$ext" | head -n 1)
  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

  return 1