license-checker icon indicating copy to clipboard operation
license-checker copied to clipboard

[Bug] Some custom format items don't seem to work properly

Open ghost opened this issue 6 years ago • 2 comments

I wanted to output the licenses with the "--customPath" option in the following format:

{
  "repository":"",
  "publisher":"",
  "email": "none"
}

However, with the exception of "repository", none of the items worked correctly, only the default values were used. (And YES the fields are filled, if I output them as JSON, they are read and displayed correctly.)

I just used all the items for testing to see which ones work and which don't:

{
  "name":"",
  "version":"",
  "description": "",
  "repository":"",
  "publisher":"",
  "email": "",
  "url": "",
  "licenses": "",
  "licenseFile":"",
  "licenseText":"",
  "licenseModified": ""
}

The result: In the columns "publisher", "email" and "url" only the default values are used. All others are output as expected.

license-crawler: 18.0.0 OS: Windows 10 Pro 64-bit Node.js: 9.11.1

ghost avatar Apr 10 '18 14:04 ghost

Was this resolved? I am having the same issue and using the following customFormat.json. The "author" and "contributors" columns are either blank or having "undefined" even there are "author" and "contributors" sections in the related package.json file.

{ "name": "", "version": "", "description": "", "author": "", "licenses": "", "contributors": "", "repository": "", "url": "" }

charliewang0104 avatar Jan 10 '19 19:01 charliewang0104

For anyone who runs into this - remove publisher: "" (also true for email and url) entirely from the customFormat.json and it will be correctly written to the file. Adding it into the customFormat.json with a blank string overwrites it being written.

alexboots avatar Oct 28 '21 22:10 alexboots