Trim whitespace/remove empty lines

This commit is contained in:
Michael B. Gale
2026-01-21 13:27:47 +00:00
parent cb2dd2ed29
commit dc2428c879
2 changed files with 6 additions and 6 deletions

View File

@@ -411,7 +411,7 @@ export async function listFiles(workingDirectory: string): Promise<string[]> {
["ls-files"],
"Unable to list tracked files.",
);
return stdout.split(os.EOL);
return stdout.split(os.EOL).filter((line) => line.trim().length > 0);
}
/**
@@ -434,8 +434,8 @@ export async function getGeneratedFiles(
const regex = /^([^:]+): linguist-generated: true$/;
for (const result of stdout.split(os.EOL)) {
const match = result.match(regex);
if (match) {
generatedFiles.push(match[1]);
if (match && match[1].trim().length > 0) {
generatedFiles.push(match[1].trim());
}
}