Advanced options and non-interactive answers
The answers to any question can be explicitly passed to the API functions to skip the question. Three secrets are unveiled.
Advanced (or hidden) options
Some options are not part of any of the strategies, i.e., they are only available in two ways:
- Use
BestieTemplate.generate
(orBestieTemplate.apply
, if updating), and after selecting the strategy, answer "Y" to the question "Do you want review each excludedj item?" - Explicitly pass the answer via a
Dict(...)
to thedata
(orextra_data
) argument of any of the API functions. More details below.
Passing the answer explicitly
The functions BestieTemplate.generate
, BestieTemplate.apply
, and BestieTemplate.new_pkg_quick
accept a dictionary as optional positional argument (see their docs). This dictionary lists the keys of the questions and the answers to the questions. So, for instance, if you want to have a "Tiny" package, except that you want pre-commit
, you can create one by making a small change to the example of changing details of new_pkg_quick
:
using BestieTemplate: new_pkg_quick
pkg_destination = joinpath(root_dir, "TinyWithPrecommit.jl")
package_owner = "JuliaBesties"
authors = "JuliaBesties maintainers"
extra_data = Dict("AddPrecommit" => true)
new_pkg_quick(
pkg_destination,
package_owner,
authors,
:tiny,
extra_data,
)
# Resulting folder: (Notice the new files in comparison to :tiny
- TinyWithPrecommit.jl/
- .copier-answers.yml
- .gitignore
- .pre-commit-config.yaml
- LICENSE
- Project.toml
- README.md
- src/
- TinyWithPrecommit.jl
- test/
- Project.toml
- runtests.jl