Added prettify option

This commit is contained in:
Nicolai Ort 2020-12-31 15:57:49 +01:00
parent 9cecefd315
commit 8103febbb6
1 changed files with 6 additions and 1 deletions

View File

@ -46,4 +46,9 @@ function getDependencyLicenseInfo(all_dependencies, recursive){
const packageInfo = parsePackageInfo(`./package.json`);
const all = getDependencyLicenseInfo(mergeDependencies(packageInfo), args.includes("--recursive"));
fs.writeFileSync('./licenses.json', JSON.stringify(all));
if(args.includes("--pretty")){
fs.writeFileSync('./licenses.json', JSON.stringify(all, null, 4));
}
else{
fs.writeFileSync('./licenses.json', JSON.stringify(all));
}