Renders tinfoil's EEx templates into the target project.
The generator is the mechanical half of mix tinfoil.init and
mix tinfoil.generate: it takes a %Tinfoil.Config{} and writes
(or returns) the files that make up the generated release pipeline:
.github/workflows/release.ymlscripts/install.sh(if installer enabled).tinfoil/formula.rb.eex(if homebrew enabled)
Summary
Functions
Return the CamelCase module name for an app atom (:my_cli -> "MyCli").
Return the list of generated files as {path, contents, executable?}
tuples relative to the project root, without touching the filesystem.
Render the lib/<app>/application.ex boilerplate used by
mix tinfoil.init --install. Not part of render/1 because this
is a one-time scaffolding artifact, not something to regenerate on
every mix tinfoil.generate.
Render a stub lib/<app>/cli.ex that <App>.Application.start/2
calls. Gives a fresh project something runnable before the user
writes their real command tree.
Write all generated files into root (defaults to the current
working directory). Returns {written, skipped} where each is a
list of relative paths.
Types
Functions
Return the CamelCase module name for an app atom (:my_cli -> "MyCli").
@spec render(Tinfoil.Config.t()) :: [generated()]
Return the list of generated files as {path, contents, executable?}
tuples relative to the project root, without touching the filesystem.
Render the lib/<app>/application.ex boilerplate used by
mix tinfoil.init --install. Not part of render/1 because this
is a one-time scaffolding artifact, not something to regenerate on
every mix tinfoil.generate.
Render a stub lib/<app>/cli.ex that <App>.Application.start/2
calls. Gives a fresh project something runnable before the user
writes their real command tree.
@spec write!( Tinfoil.Config.t(), keyword() ) :: %{written: [Path.t()], skipped: [Path.t()]}
Write all generated files into root (defaults to the current
working directory). Returns {written, skipped} where each is a
list of relative paths.
Existing files are overwritten unless force: false is passed and
the existing file differs from the generated contents (in which
case it is skipped and reported).