Skip to content

Commit

Permalink
feat: add licenseText only for customFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
Ladislav Prskavec authored and abtris committed Apr 5, 2017
1 parent 4e02eca commit dcd3b59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ The available items are the following:
- url
- licenses
- licenseFile
- licenseText
- licenseModified

You can also give default values for each item.
Expand Down
4 changes: 3 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ var flatten = function(options) {
if (!content) {
content = fs.readFileSync(moduleInfo.licenseFile, {encoding: 'utf8'});
}
moduleInfo.licenseText = content.replace(/"/g, '\'').replace(/\r?\n|\r/g, " ").trim();
if (options.customFormat) {
moduleInfo.licenseText = content.replace(/"/g, '\'').replace(/\r?\n|\r/g, " ").trim();
}
}
});

Expand Down

0 comments on commit dcd3b59

Please sign in to comment.