Skip to content

Commit 0ae9c37

Browse files
authored
fix(scripts): Prevent empty strings in changed files list
Filter Boolean removes empty strings from the array, which can happen if the git output has a trailing newline.
1 parent a4897a6 commit 0ae9c37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function getChangedFiles(): Promise<string[]> {
2929
console.log(projectRoot);
3030
const git = simpleGit(projectRoot);
3131
const diff = await git.diff(['--name-only', 'origin/main...HEAD']);
32-
const changedFiles = diff.split('\n');
32+
const changedFiles = diff.split('\n').filter(Boolean);
3333

3434
return changedFiles;
3535
}

0 commit comments

Comments
 (0)