From c2054a46c67b59aee631b434d3d5f0634627b491 Mon Sep 17 00:00:00 2001 From: Nate Choe Date: Fri, 8 Dec 2023 13:51:32 -0600 Subject: [PATCH] Appease shellcheck --- src/disk.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/disk.sh b/src/disk.sh index 1f0857c3..d8156b95 100644 --- a/src/disk.sh +++ b/src/disk.sh @@ -199,12 +199,16 @@ addDisk () { [ ! -d "${DIR}" ] && return 0 if ! [ -f "${DISK_FILE}" ] ; then - local OTHER_FORMS="$(find "${DIR}" -maxdepth 1 | sed -n -- "/\/${DISK_ROOT}\./p" | sed -- "/\.${DISK_EXT}$/d")" + local OTHER_FORMS + OTHER_FORMS="$(find "${DIR}" -maxdepth 1 | sed -n -- "/\/${DISK_ROOT}\./p" | sed -- "/\.${DISK_EXT}$/d")" if ! [[ -z "${OTHER_FORMS}" ]] ; then - local SOURCE_FILE="$(echo "${OTHER_FORMS}" | head -n1)" - local SOURCE_EXT="$(echo "${SOURCE_FILE}" | sed 's/^.*\.//')" - local SOURCE_FMT="$(ext2fmt "${SOURCE_EXT}")" + local SOURCE_FILE + local SOURCE_EXT + local SOURCE_FMT + SOURCE_FILE="$(echo "${OTHER_FORMS}" | head -n1)" + SOURCE_EXT="$(echo "${SOURCE_FILE}" | sed 's/^.*\.//')" + SOURCE_FMT="$(ext2fmt "${SOURCE_EXT}")" info "Other disk formats detected for ${DISK_DESC} (${OTHER_FORMS//$'\n'/, }), converting ${SOURCE_FILE}" if ! convertDisk "${SOURCE_FILE}" "${SOURCE_FMT}" "${DISK_FILE}" "${DISK_FMT}" ; then info "Disk conversion failed, creating new disk image as fallback"