Fix duplicated changelog entries

This commit is contained in:
mitchellhamilton
2019-09-16 18:30:00 +10:00
parent 4c85c4a584
commit c3c3ae189a
2 changed files with 4 additions and 4 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -30,17 +30,17 @@ export async function getChangedPackages(cwd: string) {
let output = await execWithOutput("git", ["diff", "--name-only"], { cwd }); let output = await execWithOutput("git", ["diff", "--name-only"], { cwd });
let names = output.stdout.split("\n"); let names = output.stdout.split("\n");
let changedWorkspaces: Workspace[] = []; let changedWorkspaces = new Set<Workspace>();
for (let name of names) { for (let name of names) {
if (name === "") continue; if (name === "") continue;
let dirname = path.resolve(cwd, path.dirname(name)); let dirname = path.resolve(cwd, path.dirname(name));
let workspace = workspacesByDirectory.get(dirname); let workspace = workspacesByDirectory.get(dirname);
if (workspace !== undefined) { if (workspace !== undefined) {
changedWorkspaces.push(workspace); changedWorkspaces.add(workspace);
} }
} }
return changedWorkspaces; return [...changedWorkspaces];
} }
export function getChangelogEntry(changelog: string, version: string) { export function getChangelogEntry(changelog: string, version: string) {