-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
using files in template parent directories to create files in generated project directories #1054
Comments
Nope, It could be argued that the rule should be relaxed to allow access within the repository, but that would be difficult to ensure since templates can also come from raw folders. Therefore, the template folder represents the broadest scope that is allowed. |
How would you recommend handling multiple templates in a single repo that all refer to files that contain the same contents? Here's an example of a bunch of examples that could also be templates if not for the shared files: https://github.com/leptos-rs/leptos/tree/main/examples |
I am also looking for something like this, in esp-rs, we will have many templates that share many of the same files, only some parts in main.rs and Cargo.toml changing. I really don't want to be duplicating a bunch of these files, across the repo.
Could you expand on this a little? I don't quite understand the connection from repo root to raw folders, are they not exclusive? I.e when calling cargo generate its either a repo via If that isn't possible/suitable, do you have any other suggestions to achieve this? I'm happy to work on a PR. |
I have a git repo with multiple generation templates.
Some of the templates have files with the same contents.
I can't find a way to use the common files to create files in the generated template.
I would like to be able to do something like.
I want this to have the effect of using the files in the
../cargo-make/
as templates for corresponding files that are created in thecargo-make
subfolder of the generated project root.Even rhai scripts only appear to be able to rename files in the generated folder or generate files from a string or array into the generated folder. The rhai scripts don't appear to allow reading a file within a parent directory of the template directory.
Is there a way to do what I want with cargo-generate right now that I am not seeing?
Thanks a bunch!
The text was updated successfully, but these errors were encountered: