Skip to content

Commit

Permalink
Add a GPL v3 LICENSE file (#22)
Browse files Browse the repository at this point in the history
* Add a LICENSE file

* added license, thanks @bnb

* script to print licenses

* Change to GPL v3

I believe it is necessary because of fnm's dependencies. If it's not, I'd be happy to make it more open

* Update package.json
  • Loading branch information
Schniz authored Feb 13, 2019
1 parent e47889a commit 02073b6
Show file tree
Hide file tree
Showing 3 changed files with 718 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .ci/print-licenses.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/usr/bin/env node

const { execSync } = require("child_process");

const groupByMap = (xs, fn, mapFn) => {
const grouped = {};

for (const x of xs) {
const key = fn(x);
grouped[key] = grouped[key] || [];
grouped[key].push(mapFn(x));
}

return grouped;
};

const licenses = execSync('grep -r "license:" esy.lock')
.toString()
.split("\n")
.map(x => x.trim())
.filter(Boolean)
.map(line => {
const [path, , license] = line.split(":");
const dependency = path
.split("/")
.slice(1)
.join("/")
.match(/^(.+)\/[^/]+$/)[1];
return { dependency, license: JSON.parse(license.trim()) };
});

const byLicense = groupByMap(
licenses,
({ license }) => license,
({ dependency }) => dependency
);

for (const [license, packages] of Object.entries(byLicense)) {
console.log(`${license}:`);
for (const package of packages) {
console.log(` - ${package}`);
}
}
Loading

0 comments on commit 02073b6

Please sign in to comment.