| 29 | const LICENSED = _.template(COPYRIGHT.concat(LICENSE).join('\n')); |
| 30 | |
| 31 | function getCustomTemplate(customLicenseLines = []) { |
| 32 | if (typeof customLicenseLines === 'string') { |
| 33 | customLicenseLines = [customLicenseLines]; |
| 34 | } |
| 35 | let CUSTOM = _.template(COPYRIGHT.join('\n')); |
| 36 | if (customLicenseLines.length) { |
| 37 | let copyrightLines = COPYRIGHT; |
| 38 | if (customLicenseLines.some(line => line.includes('Copyright'))) { |
| 39 | copyrightLines = []; |
| 40 | } |
| 41 | CUSTOM = _.template(copyrightLines.concat(customLicenseLines).join('\n')); |
| 42 | } |
| 43 | return CUSTOM; |
| 44 | } |
| 45 | |
| 46 | // Patterns for matching previously generated copyright headers |
| 47 | const BLANK = /^\s*$/; |