Coder Social home page Coder Social logo

Comments (4)

MarcoIeni avatar MarcoIeni commented on July 29, 2024

Yes, but with the latest release of cargo generate this can be solved. We have to include the file conditionally.
If you want to contribute I can explain better. Otherwise I can have this done by next week.

from template.

midnightexigent avatar midnightexigent commented on July 29, 2024

I can give it a shot

from template.

MarcoIeni avatar MarcoIeni commented on July 29, 2024

Oh, actually the feature was merged 10 days ago here but it is not released yet. I guess it will be released in the next version.

If you want starting working on it you can build cargo generate from the master branch. Otherwise we can wait until it is released :)

How to solve the issue

Ignore files conditionally

Here there is the documentation on how to ignore files based on a condition.
I guess that in the file cargo-generate.toml we have to add something like:

[conditional.'crate_type == "lib"']
ignore = [ "src/main.rs" ]

[conditional.'crate_type == "bin"']
ignore = [ "src/lib.rs" ]

Bump minimum version

This will be available since cargo-generate 0.10.0 ( or 0.9.1? 🤔), so you have to bump the version here.

Tip

For testing this locally you can use this.

from template.

MarcoIeni avatar MarcoIeni commented on July 29, 2024

closed by #13

from template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.