Skip to content

Commit

Permalink
Merge pull request #101 from aws-beam/skip-modules-with-no-actions
Browse files Browse the repository at this point in the history
Skip modules which do not contain any actions and hence do not generate valid code
  • Loading branch information
onno-vos-dev authored Dec 15, 2023
2 parents c6aec7c + b3e800a commit 506a18e
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 506a18e

Please sign in to comment.