Switched to automatic license attribution generation via oss-attribution-generator
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
#59
This commit is contained in:
parent
ab7110d49f
commit
580a73f9a5
|
@ -42,7 +42,7 @@ steps:
|
|||
image: node:alpine
|
||||
commands:
|
||||
- yarn
|
||||
- yarn licenses:full
|
||||
- yarn licenses:export
|
||||
- name: push new licenses file to repo
|
||||
depends_on: ["run full license export"]
|
||||
image: appleboy/drone-git-push
|
||||
|
|
|
@ -133,4 +133,5 @@ build
|
|||
*.sqlite
|
||||
*.sqlite-jurnal
|
||||
/docs
|
||||
lib
|
||||
lib
|
||||
/oss-attribution
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -59,7 +59,7 @@
|
|||
"cp-cli": "^2.0.0",
|
||||
"jest": "^26.6.3",
|
||||
"nodemon": "^2.0.6",
|
||||
"license-checker": "^25.0.1",
|
||||
"oss-attribution-generator": "^1.7.1",
|
||||
"rimraf": "^2.7.1",
|
||||
"start-server-and-test": "^1.11.6",
|
||||
"ts-jest": "^26.4.4",
|
||||
|
@ -76,8 +76,7 @@
|
|||
"test:ci": "start-server-and-test dev http://localhost:4010/api/docs/openapi.json test",
|
||||
"seed": "ts-node ./node_modules/typeorm/cli.js schema:sync && ts-node ./node_modules/typeorm-seeding/dist/cli.js seed",
|
||||
"openapi:export": "node scripts/openapi_export.js",
|
||||
"licenses:export": "node scripts/license_exporter.js",
|
||||
"licenses:full": "node scripts/license_exporter.js --full"
|
||||
"licenses:export": "rimraf ./LICENSES.txt && generate-attribution && cp-cli ./oss-attribution/attribution.txt ./LICENSES.txt && rimraf ./oss-attribution"
|
||||
},
|
||||
"nodemonConfig": {
|
||||
"ignore": [
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
var checker = require('license-checker');
|
||||
var consola = require('consola');
|
||||
var fs = require('fs');
|
||||
|
||||
var args = process.argv.slice(2);
|
||||
|
||||
checker.init({
|
||||
start: './',
|
||||
relativeLicensePath: true,
|
||||
customFormat: {
|
||||
licenseText: "",
|
||||
licenseFile: "",
|
||||
description: "",
|
||||
version: "",
|
||||
}
|
||||
}, function (err, packages) {
|
||||
if (err) {
|
||||
consola.error("Couldn't load the licenses.")
|
||||
} else {
|
||||
let licenses = new Array();
|
||||
if (args.includes("--full")) {
|
||||
Object.keys(packages).forEach(function (key) {
|
||||
licenses.push({
|
||||
"name": packages[key].name,
|
||||
"licenses": packages[key].licenses,
|
||||
"repository": packages[key].repository || null,
|
||||
"publisher": packages[key].publisher || null,
|
||||
"email": packages[key].email || null,
|
||||
"version": packages[key].version || null,
|
||||
"description": packages[key].description || null,
|
||||
"copyright": packages[key].copyright || null,
|
||||
"text": packages[key].licenseText || null,
|
||||
"license_path": packages[key].licenseFile || null,
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
Object.keys(packages).forEach(function (key) {
|
||||
licenses.push({
|
||||
"name": packages[key].name,
|
||||
"licenses": packages[key].licenses,
|
||||
"repository": packages[key].repository || null,
|
||||
"publisher": packages[key].publisher || null,
|
||||
"email": packages[key].email || null,
|
||||
"version": packages[key].version || null,
|
||||
"description": packages[key].description || null,
|
||||
"copyright": packages[key].copyright || null,
|
||||
});
|
||||
});
|
||||
}
|
||||
try {
|
||||
fs.writeFileSync("./licenses.json", JSON.stringify(licenses), { encoding: "utf-8" });
|
||||
consola.success("Exported licenses to ./licenses.json");
|
||||
} catch (error) {
|
||||
consola.error("Couldn't export the licenses");
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue