fix: use proper disk iteration
This commit is contained in:
parent
ab01803bc5
commit
e4990c5035
@ -159,7 +159,7 @@ list_disks() {
|
||||
count=0
|
||||
log "info" "Available disks"
|
||||
for disk in ${disks}; do
|
||||
printf "%s\n" "${count}.)" "${disk}"
|
||||
printf "%s %s\n" "${count}.)" "${disk}"
|
||||
count=$((count + 1))
|
||||
done
|
||||
}
|
||||
@ -194,12 +194,12 @@ install() {
|
||||
list_disks "${available_disks}"
|
||||
read -rp "Select a disk number to install arch linux to: " disk_selected
|
||||
|
||||
if "${disk_selected}" -eq "${disk_selected}" 2>/dev/null; then
|
||||
:
|
||||
else
|
||||
case $disk_selected in
|
||||
'' | *[!0-9]*)
|
||||
log "error" "A number was not passed"
|
||||
continue
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "${disk_selected}" -gt "${disk_count}" ]]; then
|
||||
log "error" "Invalid disk number passed, received ${disk_selected}, but the maximum disk number is ${disk_count}"
|
||||
|
Loading…
Reference in New Issue
Block a user