Keats / kickstart

A scaffolding tool to get new projects up and running quickly
MIT License
354 stars 24 forks source link

.gitignore files ignored on kickstart #24

Closed Arteneko closed 4 years ago

Arteneko commented 5 years ago

I have a template (here) that contains a .gitignore file, but when I try to kickstart it, everything's copied, except for the gitignore file, which I'd like to include.

Any bug or implicit rule related to that?

Keats commented 5 years ago

Yes, right now VCS files are ignored: https://github.com/Keats/kickstart/blob/master/src/generation.rs#L99 I don't entirely remember the reason for that though

Arteneko commented 5 years ago

Maybe it would be to, by default, avoid copying the kickstart template's .gitignore file?

Still, for now I think it should be mentioned, or made more explicit on the readme, then later changed.

Why not do a "dotffiles" config parameter?

You'd have a file named gitignore, and a config entry dotfiles = [ "gitignore" ], and the behaviour would be to copy the file, adding a . on the destination filename.

That'd also allow having every dotfile in "clear" and not "hidden by default" like on Unix-based systems.

Keats commented 4 years ago

That sounds good but maybe some general could make it easier. Eg the template from git has to be in a folder with a specific name and everything in it is copied with no regards to VCS or not. That allows each template to have their own README, CI, docs etc out of the actual template. I think that's what cookiecutter does. At least using it on https://github.com/pydanny/cookiecutter-django gives me the content of https://github.com/pydanny/cookiecutter-django/tree/master/%7B%7Bcookiecutter.project_slug%7D%7D The folder name can easily be made configurable as well.

Arteneko commented 4 years ago

Wouldn't a way to specifically ignore (or include) files be a technically valid solution?

I've never tried cookiecutter, so I can't attest on how they manage it.

Keats commented 4 years ago

It would work but look at a big template like https://github.com/pydanny/cookiecutter-django which has tons of files not part of the template. It seems the whitelist approach would be easier than the blacklist one here

Keats commented 4 years ago

Not happening anymore when v1 is released