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

Generate one project from many templates. #211

Closed
xoac opened this issue Feb 2, 2020 · 2 comments
Closed

Generate one project from many templates. #211

xoac opened this issue Feb 2, 2020 · 2 comments

Comments

@xoac
Copy link
Contributor

xoac commented Feb 2, 2020

I was looking for a nice tool that will help me start with project. This looks quite good but I would propose to modify idea a little. This could make a steps that generate a full project instead of using just one source. For example:

  1. Add license (choose one or many)
  2. Add CI (this would be a template that will ask some question and create a basic defaults).
  3. Add keepchangelog
  4. Add code-of-conduct
  5. Setup it as CLI / Webassebly or no_std project.

This idea is to make generate very customable. Instead of using one source allow using many of them. Of course there can conflict - but this would be small disadvantage of this solution.

At the end of day people would be creating own templates in seconds by removing or adding new templates.

This can start with:

cargo generate 
 Past link to source of 1 template:
>  https://git..... (here a link to it)
     > Question from this templates
     > (..)

 Past link to source of 2 template or empty to end:
> 
(...)

Threre could be a configuration file in ~/.config/cargo-generate/templates where we could store own steps:

cli:
 - http://git...
 - http://git..

Usage

cargo generate cli 
@k0pernicus
Copy link
Collaborator

Hi @xoac

Based on my experience, best would be a shell script with a basic for-loop in your URL instead of letting the CLI doing this...
Especially for error handling and user interaction.

Something like this could be helpful for you, no?

for URL in https://github.com/x/project-a https://github.com/x/project-b; do
    cargo generate --git $URL ...
done 

@sassman
Copy link
Member

sassman commented Apr 12, 2021

relates to #291, so that partials can be used to slice and dice a project into several repositories as well.
Since this is a very specific use case I guess we won't implement a generic "pass as many templates" to compile one project out of it.

I recommend a shell function to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants