mirror of
https://github.com/tiktok/sparo.git
synced 2024-11-23 07:38:15 -05:00
fix: dedup temporary selections
This commit is contained in:
parent
b8bec76c35
commit
f6df534f02
1 changed files with 15 additions and 8 deletions
|
@ -344,19 +344,26 @@ ${availableProfiles.join(',')}
|
|||
const fromSelector: Set<string> = fromProjects || new Set();
|
||||
// If Rush Selector --to <projects> is specified, using `git sparse-checkout add` to add folders of the projects specified
|
||||
const projectsSelections: ISelection[] = [...rushSelectorState];
|
||||
const existingSelections: Set<string> = new Set<string>(
|
||||
rushSelectorState.map(({ selector, argument }) => `${selector}$$${argument}`)
|
||||
);
|
||||
|
||||
for (const project of toSelector) {
|
||||
if (!existingSelections.has(`--to$$${project}`)) {
|
||||
projectsSelections.push({
|
||||
selector: '--to',
|
||||
argument: project
|
||||
});
|
||||
}
|
||||
}
|
||||
for (const project of fromSelector) {
|
||||
if (!existingSelections.has(`--from$$${project}`)) {
|
||||
projectsSelections.push({
|
||||
selector: '--from',
|
||||
argument: project
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (projectsSelections.length > 0) {
|
||||
await this._syncRushSelectors(projectsSelections);
|
||||
|
|
Loading…
Reference in a new issue