diff --git a/apps/sparo-lib/src/services/SparoProfileService.ts b/apps/sparo-lib/src/services/SparoProfileService.ts index bbbae27..4446ebf 100644 --- a/apps/sparo-lib/src/services/SparoProfileService.ts +++ b/apps/sparo-lib/src/services/SparoProfileService.ts @@ -344,18 +344,25 @@ ${availableProfiles.join(',')} const fromSelector: Set = fromProjects || new Set(); // If Rush Selector --to is specified, using `git sparse-checkout add` to add folders of the projects specified const projectsSelections: ISelection[] = [...rushSelectorState]; + const existingSelections: Set = new Set( + rushSelectorState.map(({ selector, argument }) => `${selector}$$${argument}`) + ); for (const project of toSelector) { - projectsSelections.push({ - selector: '--to', - argument: project - }); + if (!existingSelections.has(`--to$$${project}`)) { + projectsSelections.push({ + selector: '--to', + argument: project + }); + } } for (const project of fromSelector) { - projectsSelections.push({ - selector: '--from', - argument: project - }); + if (!existingSelections.has(`--from$$${project}`)) { + projectsSelections.push({ + selector: '--from', + argument: project + }); + } } if (projectsSelections.length > 0) { diff --git a/common/changes/sparo/fix-dedup-temporary-selections_2024-05-10-00-44.json b/common/changes/sparo/fix-dedup-temporary-selections_2024-05-10-00-44.json new file mode 100644 index 0000000..6b6ce60 --- /dev/null +++ b/common/changes/sparo/fix-dedup-temporary-selections_2024-05-10-00-44.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "sparo", + "comment": "", + "type": "none" + } + ], + "packageName": "sparo" +} \ No newline at end of file