Create the README linked sections only if there is a file already
gabipetrovay opened this issue · comments
Create the "How to contribute" section only if there is a CONTRIBUTING.md
file. Same with the license or documentation.
Add the extra option (-a, --all
or -f, --force
or -o, --overwrite
) that generates all the linked files automatically (also overwrites them).
To this last comment, there should be a warning if one wants to overwrite an existing file. This module is a good place to start but will not be able to generate everything for everyone. So the users will partially modify some of the generated files. Using a confirmation to overwrite and a forcing parameter could come handy in this case.
This should be done in the template.
In my README.ejs
template I have:
<% // How to contribute %>
<% if (_.pack.blah.show_contributing !== false) { %>
## How to contribute
Have an idea? Found a bug? See [how to contribute][contributing].
<% } %>
Probably that can be improved into something like:
<% if (_.pack.blah.show_contributing !== false && isThere("CONTRIBUTING.md")) { %>
## How to contribute
Have an idea? Found a bug? See [how to contribute][contributing].
<% } %>
Anyways, I always want a CONTRIBUTING.md
file.
Add the extra option (-a, --all or -f, --force or -o, --overwrite) that generates all the linked files automatically (also overwrites them).
Since the content is supposed to be generated and since we anyway have git repositories, I don't think there is a use case for it. 💭
Anyways, I always want a CONTRIBUTING.md file.
Well, not everybody wants it. 👥
The most common use case for changing the generated files is to changes .gitignore
files but random changes in others files are also possible. So, even if you have git, it will make you loose some time reverting to a previous version because you forgot you changed some things. Also not everyone wants to save a copy of the templates in the repo. This causes duplication. They could come from another repo. For example, one change that I have to do is adding the .blah
directory to the .gitignore
Still, generating all files at once could be a nice feature. Is this possible, btw.?
Probably that can be improved into something like
Then why closing this issue already? 😄
Well, not everybody wants it. 👥
Then, they shouldn't run blah -c
😂
Then why closing this issue already? 😄
Because it should be fixed in the template, not in the blah core. 😛
I'm thinking that maybe having a ~/.blah.json
file for global configurations would be handy enough where we could have an option for overriding the things:
{
"override": true
}
Maybe running blah
alone, should generate the whole shebang 💥 and -r
, -c
, etc is for low lever geeks. Default, is generating all the files possible. Why not a blag
configuration in the package.json
?
Why not a blag configuration in the package.json?
It could be, but it will override the global config. Basically the priority will be:
- CLI options
blah
inpackage.json
or maybeblah.json
~/.blah.json
- Default values
👍
Maybe running blah alone, should generate the whole shebang 💥 and -r, -c, etc is for low lever geeks.
@gabipetrovay This will be available in 3.0.0
(already pushed in the feature branch). By running blah
, the doc files will be created (CONTRIBUTING, README, LICENSE etc) if they are missing. To override possibly existing files, you will use -f
(or --force
).
Also, improved the templates like you mentioned. 😁