Closed alexeagle closed 6 months ago
You can supply arguments after the path, we do some "basic" logic to turn those arguments into variables
See
This isn't something I thought a ton about so I'm happy to consider alternative APIs and/or fix issues with this approach.
Okay, I did some more digging and it looks like this isn't possible, you will always be prompted. I see two options here
Option 1
Add --no-interaction
flag that skips Q/A and just use the arguments like I show above
Option 2
Add a --test
flag and introduce a test
top level property into the scaffold file that will be used as variables for test
test:
Var1: value 1
Var2: value 2
I'm more keen on option 2, but I'm open to any suggestions you have
I'd like to know that the content of the scaffold produces a working output, by writing a simple automation to call
scaffold
, thencd
into the new folder and run something on the code inside.I tried several of the techniques on https://www.baeldung.com/linux/bash-interactive-prompts to supply prompt answers over stdin, but have errors like:
Alternatively I suppose you could have a first-class support for testing by allowing the
scaffold
CLI to accept a "script" with expected prompts and supplied answers.