Skip to content

Commit

Permalink
Add error detection when generating wizards
Browse files Browse the repository at this point in the history
  • Loading branch information
smaarn committed Aug 6, 2023
1 parent 1d6dd0f commit c4e411a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mk/spksrc.spk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,17 @@ ifneq ($(strip $(WIZARDS_TEMPLATES_DIR)),)
template_file_path="$(WIZARDS_TEMPLATES_DIR)/$${template_filename}"; \
for suffix in '' $(patsubst %,_%,$(LANGUAGES)) ; do \
template_file_localization_data_path="$(WIZARDS_TEMPLATES_DIR)/$${template_name}$${suffix}.yml"; \
output_file="$(WIZARDS_DIR)/$${template_name}$${suffix}$${template_suffix}"; \
if [ -f "$${template_file_localization_data_path}" ]; then \
mustache -e \
"$${template_file_localization_data_path}" \
"$${template_file_path}" >"$(WIZARDS_DIR)/$${template_name}$${suffix}$${template_suffix}"; \
"$${template_file_path}" >"$${output_file}"; \
errors=$$(jq . "$${output_file}" 2>&1); \
if [ "$$?" != "0" ]; then \
echo "Invalid wizard file generated $${output_file}:"; \
echo "$${errors}" \
exit 1; \
fi; \
fi; \
done; \
done
Expand Down

0 comments on commit c4e411a

Please sign in to comment.