Skip to content

Commit

Permalink
Skip modules which do not contain any actions and hence do not genera…
Browse files Browse the repository at this point in the history
…te valid code
  • Loading branch information
onno-vos-dev committed Dec 15, 2023
1 parent c6aec7c commit b3e800a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/aws_codegen.ex
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,16 @@ defmodule AWS.CodeGen do
template_path = Path.join(template_base_path, template)

context = protocol_service.load_context(language, spec, endpoints_spec)
code = render(context, template_path)
case Map.get(context, :actions) do
[] ->
IO.puts(["Skipping ", spec.module_name, " due to no actions"])
_ ->
code = render(context, template_path)

IO.puts(["Writing ", spec.module_name, " to ", output_path])

File.write(output_path, code)
end
else
IO.puts("Failed to generate #{spec.module_name}, protocol #{spec.protocol}")
end
Expand Down

0 comments on commit b3e800a

Please sign in to comment.