-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo new --template ignores/replaces/overwrites .gitignore #3859
Comments
cargo new --template
overwrites .gitignorecargo new --template
ignores/replaces/overwrites .gitignore
cargo new --template
ignores/replaces/overwrites .gitignore
If I understand correctly, your template has a |
Yes, that's correct. The template contains a
|
Yeah makes sense to me as well to use the |
Templates have been removed pending an RFC. There is a pre-RFC thread here. I think this can be closed for now. |
Thanks @ehiggs! |
While investigating another flaw in
--template
, I discovered the following undesired behaviour when generating a test project from my boilerplate for CLI utilities:While I admit I forgot to exclude *.rs.bk, the rest is unhelpful.
What's worse is that I don't see how this actually helps anything, given that, for a project template, there isn't really much of a purpose to
.gitignore
outside of being passed on to the generated projects. (It's not as if the template'sCargo.toml
is valid TOML before the placeholder for the author list gets substituted.)You'll also notice that it's adding
Cargo.lock
to the.gitignore
when this is specifically intended as--bin
project template, not a--lib
one, so that's not helpful either.I think a proper solution would be to only generate a .gitignore if none is present in the template
As-is, I'm forced to go back to what I used before... a wrapper script.
The text was updated successfully, but these errors were encountered: