From f68f37671fbbb74cd158561fa8cd7d29625af3a8 Mon Sep 17 00:00:00 2001 From: Nixinova Date: Sat, 9 Mar 2024 00:29:03 +1300 Subject: [PATCH] Change regexp to match Windows too Since the split uses `\n` leaving an `\r` on Windows, CRLF endings do not seem to be properly matched by `$`. --- src/helpers/parse-gitattributes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/parse-gitattributes.ts b/src/helpers/parse-gitattributes.ts index 3c914a4..ece21e4 100644 --- a/src/helpers/parse-gitattributes.ts +++ b/src/helpers/parse-gitattributes.ts @@ -22,7 +22,7 @@ export default function parseAttributes(content: string, folderRoot: string = '. const output: ParsedGitattributes = []; for (const rawLine of content.split('\n')) { - const line = rawLine.replace(/#.*$/, '').trim(); + const line = rawLine.replace(/#.*/, '').trim(); if (!line) continue; const parts = line.split(/\s+/g);