Keats / kickstart

A scaffolding tool to get new projects up and running quickly
MIT License
359 stars 24 forks source link

feat: add previous responses as a default #58

Closed EclesioMeloJunior closed 2 years ago

EclesioMeloJunior commented 2 years ago

Description

Use a previous response/default value as value to another variable into toml file

Example

The following toml file describes the feature included in this PR, basically will be possible to use a variable template to get already assigned values from other variables. eg will be assigned to the manifest variable the value my_project-other_project-manifest.md if the user leave the all the inputs empty, however if the user populate the variable project_one with tree and variable project_two with leaf and leave manifest variable empty then the value assigned to manifest will be tree-leaf-manifest.md.

[[variables]]
name = "project_one"
default = "my_project"
prompt = "What's the name of your first project?"

[[variables]]
name = "project_two"
default = "other_project"
prompt = "What's the name of your second project?"

[[variables]]
name = "manifest"
default = "{{project_one}}-{{project_two}}-manifest.md"
prompt = "What's the manifest name file?"

The prompt default value is updated too! image

Issue

https://github.com/Keats/kickstart/issues/22

EclesioMeloJunior commented 2 years ago

got it! never used Tera before, I will address your comments asap!

Keats commented 2 years ago

Thanks, I'll merge it and tweak a bit later this week