Missing license file
TiagoDanin opened this issue ยท 5 comments
TiagoDanin commented
Please add license file :)
zeke commented
Yeah still looking for an automated way to add LICENSE files to all my packages, by inferring from license
in package.json...
billiegoose commented
Ooooh, hang on. I had something that did (part) of that. Hang on... https://github.com/wmhilton/create-node-module/blob/js/src/license.js
Here's what I'm thinking:
- use something like
packages-by-user
to get all your packages. Or maybe just use the github API - for each repo
- do a simple 404 check (e.g.
https://github.com/{user}/{repo}/blob/master/LICENSE.md
) and skip to next repo if not needed - clone repo
- read package.json
license
field - use the
spdx-license-list/full
module to write a LICENSE file- replace
"<year>"
withnew Date().getFullYear()
- replace
"<copyright holder>"
with user name... either from Github profile or from package.jsonauthor
field
- replace
git add LICENSE.md && git commit -m 'Add missing LICENSE' && git push
- do a simple 404 check (e.g.
Part of me thinks this should be a Probot on Glitch... you can fork https://glitch.com/~isomorphic-git-bot which already does several of the above steps.
zeke commented
Part of me thinks this should be a Probot on Glitch...
That would be cool. Install it on an org and it opens PRs as necessary.
billiegoose commented
Install it on an org and it opens PRs as necessary.
Exactly.
zeke commented
Opened probot/ideas#80