The ceres template repository must contain a ceres.toml
file and a template
folder.
ceres.toml
contains the following sections:
- common
- variables
- include_path_rules
- exclude_path_rules
- scripts
variables = ["use_config", "use_logger"]
key | description |
---|---|
variables |
list of variables. ceres will ask the user for data in the order of the list. Variables must be generated in the variables section. |
Ceres will ask the user one by one in the order of the common.variables
list.
The result is stored in map[string]string
for data passed into the template.
[variables]
[variables.module_name]
message = "Your module name:"
type = "input"
meta = ["github.com/cqroot/ceres"]
The available values for type are:
input
: meta only accepts a string, which is the default value of input.toggle
: meta receives multiple strings, which are options provided to the user (Usually used for yes or no choices).choose
: meta receives multiple strings, which are options provided to the user.
Generate the file only if the condition is met.
The filename can be a directory or a file, but do not end with '/'.
"src/config" = { key = "use_config", value = "Yes" }
Same as include_path_rules
.
after = ["scripts/init.sh"]
key | description |
---|---|
after |
Script to execute after all generation. |