Skip to content

Commit c7d5e44

Browse files
committed
Fix file_extension extraction for Hyper-V cloud images
Handle compound hyperv.zip.* extensions in extract_file_extension function to correctly identify file extensions for cloud images like Armbian_*_minimal.hyperv.zip.xz Signed-off-by: Igor Pecovnik <igor@armbian.com>
1 parent 8a4bb1a commit c7d5e44

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/generate-armbian-images-json.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,16 @@ extract_file_extension() {
412412
return
413413
fi
414414

415+
# hyperv cloud images: minimal.hyperv.zip.xz -> hyperv.zip.xz
416+
if [[ "$n" == *".hyperv.zip."* ]]; then
417+
echo "hyperv.zip.${n##*.hyperv.zip.}"
418+
return
419+
fi
420+
if [[ "$n" == *.hyperv.zip ]]; then
421+
echo "hyperv.zip"
422+
return
423+
fi
424+
415425
# fallback
416426
echo "${n##*.}"
417427
}

0 commit comments

Comments
 (0)