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 changing src_path on updates #5

Open
doshitan opened this issue Nov 12, 2024 · 0 comments
Open

Support changing src_path on updates #5

doshitan opened this issue Nov 12, 2024 · 0 comments

Comments

@doshitan
Copy link
Contributor

doshitan commented Nov 12, 2024

Currently copier's logic[1][2] when running updates is to always pull the template path from the answers file in the project. The nava-platform infra commands support a --template-uri option to say which template source to use, but this currently has no impact. So we could drop that option from the update commands or, more usefully, hook into copier's "subproject" logic[3] to override the src_path to the returned Template to be the path passed as a CLI argument.

The current limitation likely impacts template authors (who may want to run test updates from a locally modified template repo when the project is configured to use a remote URL) more so than users, but could get users into frustrating situations if different people are running updates from different paths (e.g., from within the project repo vs one level above) and hitting errors.

[1] https://github.com/copier-org/copier/blob/19156ee3be576a72ba8603137b25e227fde28021/copier/subproject.py#L75-L78
[2] https://github.com/copier-org/copier/blob/9ddee994722bc523c4c3550ba0f33742cd6bf168/copier/main.py#L934
[3] https://github.com/copier-org/copier/blob/9ddee994722bc523c4c3550ba0f33742cd6bf168/copier/main.py#L780

@doshitan doshitan changed the title Support changing src_path on updates Support changing src_path answer on updates Nov 12, 2024
@doshitan doshitan changed the title Support changing src_path answer on updates Support changing src_path on updates Nov 12, 2024
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

1 participant