copier icon indicating copy to clipboard operation
copier copied to clipboard

non-iteractive mode

Open rafalkrupinski opened this issue 2 years ago • 1 comments
trafficstars

Is your feature request related to a problem? Please describe. When using Copier as a library, in case of missing answer, Copier with prompt for answers, while it might be impossible to get an an input. Same if CLI is used in an automated environment (e.g. automatic updates).

Describe the solution you'd like I'd like Copier accept a non-interactive flag, which would cause it to fail on a missing answer instead of asking for it.

Additional context I guess I should check the flag in this loop: https://github.com/copier-org/copier/blob/master/copier/main.py#L390

and add it for CLI somewhere here: https://github.com/copier-org/copier/blob/master/copier/cli.py#L80

rafalkrupinski avatar Jan 28 '23 21:01 rafalkrupinski

We have defaults to avoid asking for unpassed answers.

Jinja has https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.Undefined .

Have you tried combining both?

yajo avatar Jan 31 '23 05:01 yajo