added a minimal check for the correctness of writing scripts for auto-installing

This commit is contained in:
Mikhail Tergoev 2024-10-04 10:56:35 +03:00
parent b0932e5f4c
commit fc20dc69f9

@ -714,6 +714,7 @@ else
done < "$ai_file"
IFS=$'\n'
[[ -z "$AI_NAME" ]] && yad_error "Line: \"name\" not found in file $AI_FILE."
case $AI_TYPE in
games)
PW_GENERATE_BUTTONS_GAMES+="--field= $AI_NAME!$PW_GUI_ICON_PATH/$AI_IMAGE.png!$AI_INFO:FBTNR%@bash -c \"button_click --normal $AI_FILE\"%"
@ -723,6 +724,9 @@ else
PW_GENERATE_BUTTONS_EMULS+="--field= $AI_NAME!$PW_GUI_ICON_PATH/$AI_IMAGE.png!$AI_INFO:FBTNR%@bash -c \"button_click --normal $AI_FILE\"%"
(( AI_AMOUNT_EMULS++ ))
;;
*)
yad_error "Line: \"type\" not found in file $AI_FILE or misspelled."
;;
esac
[[ -z $PW_DEBUG ]] && unset AI_FILE AI_TYPE AI_NAME AI_IMAGE AI_INFO
done