Using and Mastering Cookiecutter Transcripts
Chapter: Advanced Cookiecutter usage
Lecture: No inputs
0:02 I told you that the no inputs feature might be really nice
0:06 for continuous integration and this is not a CI build machine or anything,
0:10 but let's go and have a look anyway.
0:12 So we can run cookiecutter cookiecutter-bottle
0:15 and it was going to ask us some questions,
0:18 now let's just take the all of the defaults for now,
0:21 so if I say yes this is my name, this is my email address,
0:24 this is my GitHub user, whatever,
0:27 boom, and then it's going to generate this mybottlea.
0:30 Alright, so if we go and look in here, we'll see that things like,
0:34 we'll see it named it mybottle like we had said,
0:37 if we look at the read me you can see it's just taken the defaults everywhere,
0:41 okay, so that's all going good, let's go back out for a second here,
0:44 and erase this so we have nothing in this folder anymore.
0:48 So now we can run this again, but this time, without it asking any questions,
0:51 just say take all the defaults which is what we did anyway
0:54 but I had to hit enter a bunch of times.
0:59 So say --no-input and we hit enter, and bam, what happens,
1:06 well it generates exactly the same thing,
1:09 so if you're going to make executing a Cookiecutter template
1:12 as part of something like continuous integration build
1:15 or if for whatever reason you want to run it
1:18 without it asking the user questions then you got this.
1:20 You'll see that we can actually pass additional information
1:22 to overwrite some of those values, when we run this
1:25 when we get to consuming the Cookiecutter API
1:27 you will see that you can pass no input
1:29 but then overwrite it with stuff that maybe your program asks for,
1:32 things like that, so it's pretty cool, but this is a good start,
1:35 I guess the most common use case I see here
1:38 really is for continuous integration or some form of testing.