mirror of https://github.com/laurent22/joplin.git
Generator: Fixed issue with handling of CRLF in ignore file (#4956)
parent
1a84ca204e
commit
ce80d7e883
|
@ -41,7 +41,7 @@ function mergePackageKey(parentKey, source, dest) {
|
|||
}
|
||||
|
||||
function mergeIgnoreFile(source, dest) {
|
||||
const output = dest.trim().split('\n').concat(source.trim().split('\n'));
|
||||
const output = dest.trim().split(/\r?\n/).concat(source.trim().split(/\r?\n/));
|
||||
|
||||
return `${output.filter(function(item, pos) {
|
||||
if (!item) return true; // Leave blank lines
|
||||
|
|
|
@ -33,6 +33,9 @@ describe('utils', () => {
|
|||
const testCases = [
|
||||
['line1\nline2\n', 'newline\n', 'line1\nline2\nnewline\n'],
|
||||
['line1\nline2\n', 'line1\nnewline\n', 'line1\nline2\nnewline\n'],
|
||||
['line1\r\nline2\r\n', 'line1\nnewline\n', 'line1\nline2\nnewline\n'],
|
||||
['line1\nline2\n', 'line1\r\nnewline\r\n', 'line1\nline2\nnewline\n'],
|
||||
['line1\r\nline2\r\n', 'line1\r\nnewline\r\n', 'line1\nline2\nnewline\n'],
|
||||
];
|
||||
|
||||
for (const t of testCases) {
|
||||
|
|
Loading…
Reference in New Issue