Skip to content

Using answers file in a subdirectory is difficult #2183

Open
@johbo

Description

@johbo

Describe the problem

I did try to locate the answers file in a subdirectory:

copier copy -a '.config/copier-answers.my-module.yaml' ~/w/copier-templates/my-module .

This did always render the answers file in the current folder instead of in a subfolder .config.

Template

Trying with the template from the documentation causes the issue:

{{_copier_conf.answers_file}}.jinja

While experimenting I found the following workaround which renders the file in the desired location:

{{ "." ~ _copier_conf.sep ~ _copier_conf.answers_file }}.jinja

To Reproduce

No response

Logs

Expected behavior

Based on the documentation I did assume that using a subfolder would just work with the documented template name.

Screenshots/screencasts/logs

No response

Operating system

macOS

Operating system distribution and version

macOS 14.7

Copier version

9.6.0

Python version

Installed via nix, assuming it uses Python 3.12 at the moment

Installation method

distro package

Additional context

Installed via Nix:

nix profile install nixpkgs#copier

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriageTrying to make sure if this is valid or not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions