Skip to content

Commit dc2428c

Browse files
committed
Trim whitespace/remove empty lines
1 parent cb2dd2e commit dc2428c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/init-action.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/git-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ export async function listFiles(workingDirectory: string): Promise<string[]> {
411411
["ls-files"],
412412
"Unable to list tracked files.",
413413
);
414-
return stdout.split(os.EOL);
414+
return stdout.split(os.EOL).filter((line) => line.trim().length > 0);
415415
}
416416

417417
/**
@@ -434,8 +434,8 @@ export async function getGeneratedFiles(
434434
const regex = /^([^:]+): linguist-generated: true$/;
435435
for (const result of stdout.split(os.EOL)) {
436436
const match = result.match(regex);
437-
if (match) {
438-
generatedFiles.push(match[1]);
437+
if (match && match[1].trim().length > 0) {
438+
generatedFiles.push(match[1].trim());
439439
}
440440
}
441441

0 commit comments

Comments
 (0)