Fix the issue when set F2> as the default menu item.

This commit is contained in:
longpanda 2022-02-23 17:05:33 +08:00
parent c3718d6001
commit ebae102f41

View file

@ -2321,6 +2321,32 @@ export VTOY_HELP_TXT_LANGUAGE
export VTOY_CHKSUM_FILE_PATH
#colect all image files (iso files)
set ventoy_img_count=0
vt_list_img $vtoy_iso_part ventoy_img_count
#Main menu
if [ $ventoy_img_count -gt 0 ]; then
if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
vt_dynamic_menu 0 0
else
vt_dynamic_menu 0 1
fi
else
if [ -n "$VTOY_NO_ISO_TIP" ]; then
NO_ISO_MENU="No ISO files found, $VTOY_NO_ISO_TIP"
elif [ -n "$VTOY_DEFAULT_SEARCH_ROOT" ]; then
NO_ISO_MENU="No ISO files found, please check VTOY_DEFAULT_SEARCH_ROOT"
else
NO_ISO_MENU="No ISO files found"
fi
menuentry "$NO_ISO_MENU (Press enter to reboot ...)" {
echo -e "\n Rebooting ... "
reboot
}
fi
#special VTOY_DEFAULT_IMAGE process
if [ -n "$VTOY_DEFAULT_IMAGE" ]; then
if regexp --set 1:vtHotkey --set 2:vtDefault "(F[2-9])>(.*)" "$VTOY_DEFAULT_IMAGE"; then
@ -2351,27 +2377,3 @@ if [ -n "$VTOY_DEFAULT_IMAGE" ]; then
fi
fi
#colect all image files (iso files)
set ventoy_img_count=0
vt_list_img $vtoy_iso_part ventoy_img_count
#Main menu
if [ $ventoy_img_count -gt 0 ]; then
if [ $VTOY_DEFAULT_MENU_MODE -eq 0 ]; then
vt_dynamic_menu 0 0
else
vt_dynamic_menu 0 1
fi
else
if [ -n "$VTOY_NO_ISO_TIP" ]; then
NO_ISO_MENU="No ISO files found, $VTOY_NO_ISO_TIP"
elif [ -n "$VTOY_DEFAULT_SEARCH_ROOT" ]; then
NO_ISO_MENU="No ISO files found, please check VTOY_DEFAULT_SEARCH_ROOT"
else
NO_ISO_MENU="No ISO files found"
fi
menuentry "$NO_ISO_MENU (Press enter to reboot ...)" {
echo -e "\n Rebooting ... "
reboot
}
fi