mirror of
https://github.com/tiktok/sparo.git
synced 2025-03-14 06:59:49 -04:00
Merge pull request #70 from tiktok/fix-dedup-temporary-selections
This commit is contained in:
commit
c5f41d8e4a
2 changed files with 25 additions and 8 deletions
|
@ -344,18 +344,25 @@ ${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) {
|
||||
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) {
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"changes": [
|
||||
{
|
||||
"packageName": "sparo",
|
||||
"comment": "",
|
||||
"type": "none"
|
||||
}
|
||||
],
|
||||
"packageName": "sparo"
|
||||
}
|
Loading…
Reference in a new issue