Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support input file #50

Open
chevdor opened this issue Jun 30, 2021 · 3 comments
Open

Support input file #50

chevdor opened this issue Jun 30, 2021 · 3 comments

Comments

@chevdor
Copy link
Contributor

chevdor commented Jun 30, 2021

The ability to pass the variables using an input file would be great.

That means a user could run (for instance):

kickstart \
   https://github.com/some/template \
   --data https://gist.github.com/chevdor/050df6...c6e4207

or

curl https://gist.github.com/chevdor/050df6...c6e4207 | \
   kickstart \
      https://github.com/some/template

where in this example https://gist.github.com/chevdor/050df6...c6e4207 points to a file containing all the fields. This could be a local file or a url.

Since the template is defined in toml, a first implementation could use toml as well.
json can be helpful thanks to the pre/re-processing that can be done using jq.

That allows for instance, storing several sets of values in a single json map for instance:

curl https://gist.github.com/chevdor/050df6...c6e4207 | jq .scenario_1 \
   kickstart \
      https://github.com/some/template

where the json file could be something like:

{
   "scenario_1": {
      "greeting_recipient": "Alice"   
   },
  "scenario_2": {
      "greeting_recipient": "Bob"   
   },
}

That allows one-liners to bootstrap projects without any user input and with more flexibility than just using the default values from the template.

@Keats
Copy link
Owner

Keats commented Jun 30, 2021

Do you have an example on where you would use that? I don't see where you would use kickstart in that way

@chevdor
Copy link
Contributor Author

chevdor commented Jul 1, 2021

Testing or scaffolding your template with different inputs (not only the defaults) in CI for instance.

@hmuendel
Copy link

hmuendel commented Aug 4, 2022

I also find this useful for populating values that are bound to me personally. For example when using your CLI template I could use a file that holds my name and email and then provide it for every templating run to create a new project so I only would need to provide the changing params.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants