--image-name 防止常见错误

This commit is contained in:
bin456789 2023-06-21 23:39:08 +08:00
parent 90b2c0e0e1
commit b617858c89
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -191,6 +191,11 @@ setos() {
if [ -z "$iso" ] || [ -z "$image_name" ]; then
error_and_exit "Install Windows need --iso --image-name"
fi
# 防止常见错误
# --image-name 肯定大于等于3个单词
if [ "$(echo "$image_name" | wc -w)" -lt 3 ]; then
error_and_exit "--image-name wrong."
fi
test_url $iso iso
eval "${step}_iso='$iso'"
eval "${step}_image_name='$image_name'"