Skip to content

Commit

Permalink
[fixes #96] - do not replace newline, etc in licenses for exporting t…
Browse files Browse the repository at this point in the history
…o json/markdown
  • Loading branch information
davglass committed May 17, 2017
1 parent 98a03fa commit a0406ac
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ var flatten = function(options) {
content = fs.readFileSync(moduleInfo.licenseFile, { encoding: 'utf8' });
}
if (options.customFormat) {
moduleInfo.licenseText = content.replace(/"/g, '\'').replace(/\r?\n|\r/g, " ").trim();
if (options._args && !options._args.csv) {
moduleInfo.licenseText = content.trim();
} else {
moduleInfo.licenseText = content.replace(/"/g, '\'').replace(/\r?\n|\r/g, " ").trim();
}
}
}
});
Expand Down Expand Up @@ -195,7 +199,8 @@ var flatten = function(options) {
customFormat: options.customFormat,
production: options.production,
development: options.development,
basePath: options.basePath
basePath: options.basePath,
_args: options._args
});
});
}
Expand Down Expand Up @@ -229,7 +234,8 @@ exports.init = function(options, callback) {
customFormat: options.customFormat,
production: options.production,
development: options.development,
basePath: options.relativeLicensePath ? json.path : null
basePath: options.relativeLicensePath ? json.path : null,
_args: options
}),
colorize = options.color,
sorted = {},
Expand Down

0 comments on commit a0406ac

Please sign in to comment.